Use get_terms() in the ajax tag search.

props Chouby.
fixes #25231.

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


git-svn-id: http://core.svn.wordpress.org/trunk@25373 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2013-09-16 17:51:08 +00:00
parent 85d4685894
commit 188f763120

View File

@ -87,7 +87,7 @@ function wp_ajax_ajax_tag_search() {
if ( strlen( $s ) < 2 )
wp_die(); // require 2 chars for matching
$results = $wpdb->get_col( $wpdb->prepare( "SELECT t.name FROM $wpdb->term_taxonomy AS tt INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = %s AND t.name LIKE (%s)", $taxonomy, '%' . like_escape( $s ) . '%' ) );
$results = get_terms( $taxonomy, array( 'name__like' => $s, 'fields' => 'names', 'hide_empty' => false ) );
echo join( $results, "\n" );
wp_die();