WordPress开发者和主题制作者的搜索引擎



like_escape ›

Since2.5.0
已弃用4.0.0
like_escape ( $text )
参数:
  • (string) $text The text to be escaped.
    Required: Yes
查看:
  • wpdb::esc_like()
返回:
  • (string) text, safe for inclusion in LIKE query.
定义在:
文档:

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



源码

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