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

Props wojtek.szkutnik.
Fixes #13992.



git-svn-id: https://develop.svn.wordpress.org/trunk@25164 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2013-08-29 16:49:43 +00:00
parent 9e96365b8e
commit d34baebc1d
2 changed files with 14 additions and 3 deletions
+3 -3
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();