Search term name and slug when the search arg is passed to get_terms(). Adds unit test.

Props wojtek.szkutnik.
Fixes #13992.


Built from https://develop.svn.wordpress.org/trunk@25164


git-svn-id: http://core.svn.wordpress.org/trunk@25143 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor
2013-08-29 16:50:09 +00:00
parent eeb3b15936
commit 29952baa41

View File

@@ -1366,9 +1366,9 @@ function get_terms($taxonomies, $args = '') {
$limits = '';
}
if ( !empty($search) ) {
$search = like_escape($search);
$where .= $wpdb->prepare( " AND (t.name LIKE %s)", '%' . $search . '%');
if ( ! empty( $search ) ) {
$search = like_escape( $search );
$where .= $wpdb->prepare( ' AND ((t.name LIKE %s) OR (t.slug LIKE %s))', '%' . $search . '%', '%' . $search . '%' );
}
$selects = array();