WordPress at a glance

wc_clean() WC 1.0

Clean variables using sanitize_text_field. Arrays are cleaned recursively. Non-scalar values are ignored.

Works based on: sanitize_text_field()

No Hooks.

Return

String/Array.

Usage

wc_clean( $var );
$var(string/array) (required)
Data to sanitize.

Code of wc clean: woocommerce/includes/wc-formatting-functions.php WC 3.6.4

<?php
function wc_clean( $var ) {
	if ( is_array( $var ) ) {
		return array_map( 'wc_clean', $var );
	} else {
		return is_scalar( $var ) ? sanitize_text_field( $var ) : $var;
	}
}

Related Functions

From tag: sanitize_

More from category: WooCommerce

No comments
    Hello, !     Log In . Register