wpdb::_escape
Escapes data. Works on arrays.
Method of the class: wpdb{}
No Hooks.
Returns
String|Array. Escaped data, in the same type as supplied.
Usage
global $wpdb; $wpdb->_escape( $data );
- $data(string|array) (required)
- Data to escape.
Changelog
| Since 2.8.0 | Introduced. |
wpdb::_escape() wpdb:: escape code WP 7.0
public function _escape( $data ) {
if ( is_array( $data ) ) {
foreach ( $data as $k => $v ) {
if ( is_array( $v ) ) {
$data[ $k ] = $this->_escape( $v );
} else {
$data[ $k ] = $this->_real_escape( $v );
}
}
} else {
$data = $this->_real_escape( $data );
}
return $data;
}