noptin_clean( string|array $var )
Clean variables using sanitize_text_field.
Parameters Parameters
- $var
(string|array) (Required) Data to sanitize.
Return Return
(string|array)
Source Source
File: includes/functions.php
function noptin_clean( $var ) { if ( is_array( $var ) ) { return array_map( 'noptin_clean', $var ); } if ( is_object( $var ) ) { $object_vars = get_object_vars( $var ); foreach ( $object_vars as $property_name => $property_value ) { $var->$property_name = noptin_clean( $property_value ); } return $var; } return is_string( $var ) ? sanitize_text_field( $var ) : $var; }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
1.2.3 | Introduced. |