mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
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:
@@ -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