http://codex.wordpress.org/Function_Reference/get_terms
name__like
(string) Default is empty string.
search
(string) The term name you wish to match. It does a LIKE %term name% query.
What's the difference?
http://codex.wordpress.org/Function_Reference/get_terms
name__like
(string) Default is empty string.
search
(string) The term name you wish to match. It does a LIKE %term name% query.
What's the difference?
There is a subtle difference.
This is the "name__like" query from the get_terms() function with some explanation:
$where .= $wpdb->prepare( " AND t.name LIKE %s", $name__like . '%' );
// $where varable with $name_like = hello
// $where .= " AND t.name LIKE 'hello%'";
And the search query:
$where .= $wpdb->prepare( " AND (t.name LIKE %s)", '%' . $search . '%');
// $where varable with with $search = hello
// $where .= " AND (t.name LIKE '%hello%')";
The "name__in" parameter will do a query for terms that begin with with the "name__in" string and the "search" parameter will query for any terms that contains the "search" string.
Thanks!
I think you should put that in the codex! :)
You're welcome.
If you want, you can edit the codex yourself by logging in with your WordPress forum username and password:
http://make.wordpress.org/support/handbook/contributing-to-the-wordpress-codex/
http://codex.wordpress.org/index.php?title=Special:UserLogin&returnto=Main_Page
You must log in to post.