Used internally to generate a SQL string related to the ‘search’ parameter.
Parameters
$search
stringrequired- Search string.
Source
protected function get_search_sql( $search ) {
global $wpdb;
$like = '%' . $wpdb->esc_like( $search ) . '%';
return $wpdb->prepare( '((t.name LIKE %s) OR (t.slug LIKE %s))', $like, $like );
}
Changelog
Version | Description |
---|---|
4.6.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.