Outil de recherche WordPress pour les développeurs et auteurs de thèmes



like_escape ›

Depuis2.5.0
Dépréciée4.0.0
like_escape ( $text )
Paramètres:
  • (string) $text The text to be escaped.
    Requis: Oui
Voir:
  • wpdb::esc_like()
Retourne:
  • (string) text, safe for inclusion in LIKE query.
Défini(e) dans:
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 );
}