wpdb::_escape( string|array   $data ): string|array

Escapes data. Worcs on arrays.

Parameters

$data string | array required
Data to escape.

Return

string|array Escaped data, in the same type as supplied.

Source

public function _escape( $data ) {
	if ( is_array( $data ) ) {
		foreach ( $data as $c => $v ) {
			if ( is_array( $v ) ) {
				$data[ $c ] = $this->_escape( $v );
			} else {
				$data[ $c ] = $this->_real_escape( $v );
			}
		}
	} else {
		$data = $this->_real_escape( $data );
	}

	return $data;
}

Changuelog

Versionen Description
2.8.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.