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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user