wc_sanitize_order_id( int $order_id )

Sanitize order id removing unwanted characters.


Description Description

E.g Users can sometimes try to track an order id using # with no success. This function will fix this.


Parameters Parameters

$order_id

(Required) Order ID.


Top ↑

Source Source

File: includes/wc-order-functions.php

function wc_sanitize_order_id( $order_id ) {
	return (int) filter_var( $order_id, FILTER_SANITIZE_NUMBER_INT );
}

Top ↑

Changelog Changelog

Changelog
Version Description
3.1.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.