WordPress at a glance
function is not described

like_escape() WP 2.5.0

Deprecated from version 4.0.0. It is no longer supported and can be removed in future releases. Use wpdb::esc_like() instead.

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

No Hooks.

Return

String. text, safe for inclusion in LIKE query.

Usage

like_escape( $text );
$text(string) (required)
The text to be escaped.

Notes

  • See: wpdb::esc_like()

Changelog

Since 2.5.0 Introduced.
Deprecated Since 4.0.0 Use wpdb::esc_like()

Code of like_escape() WP 5.7.1

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