wpseek.com
A WordPress-centric search engine for devs and theme authors



like_escape › WordPress Function

Since2.5.0
Deprecated4.0.0
like_escape ( $text )
Parameters:
  • (string) $text The text to be escaped.
    Required: Yes
See:
  • wpdb::esc_like()
Returns:
  • (string) text, safe for inclusion in LIKE query.
Defined at:
Codex:

Formerly used to escape strings before searching the DB. It was poorly documented and never worked as described.



Source

function like_escape($text) {
	_deprecated_function( __FUNCTION__, '4.0.0', 'wpdb::esc_like()' );
	return str_replace( array( "%", "_" ), array( "\\%", "\\_" ), $text );
}