Warning: This method has been deprecated. Use wpdb::prepare() instead.
wpdb::escape( mixed $data )
Do not use, deprecated.
Contents
Description Description
Use esc_sql() or wpdb::prepare() instead.
See also See also
Parameters Parameters
- $data
-
(mixed) (Required)
Return Return
(mixed)
Source Source
File: wp-includes/wp-db.php
public function escape( $data ) { if ( func_num_args() === 1 && function_exists( '_deprecated_function' ) ) { _deprecated_function( __METHOD__, '3.6.0', 'wpdb::prepare() or esc_sql()' ); } if ( is_array( $data ) ) { foreach ( $data as $k => $v ) { if ( is_array( $v ) ) { $data[ $k ] = $this->escape( $v, 'recursive' ); } else { $data[ $k ] = $this->_weak_escape( $v, 'internal' ); } } } else { $data = $this->_weak_escape( $data, 'internal' ); } return $data; }
Expand full source code Collapse full source code View on Trac
Changelog Changelog
Version | Description |
---|---|
3.6.0 | Use wpdb::prepare() |
0.71 | Introduced. |