wpdb::_escape() public WP 2.8.0
Escapes data. Works on arrays.
{} It's a method of the class: wpdb{}
No Hooks.
Return
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. |
Code of wpdb::_escape() wpdb:: escape WP 5.6
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;
}