wc_sanitize_order_id()WC 3.1.0

Sanitize order id removing unwanted characters.

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

Хуков нет.


null. Ничего.


wc_sanitize_order_id( $order_id );
$order_id(int) (обязательный)
Order ID.

Список изменений

С версии 3.1.0 Введена.

Код wc_sanitize_order_id() WC 7.3.0

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