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:
parent
85d4685894
commit
188f763120
|
@ -87,7 +87,7 @@ function wp_ajax_ajax_tag_search() {
|
||||||
if ( strlen( $s ) < 2 )
|
if ( strlen( $s ) < 2 )
|
||||||
wp_die(); // require 2 chars for matching
|
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" );
|
echo join( $results, "\n" );
|
||||||
wp_die();
|
wp_die();
|
||||||
|
|
Loading…
Reference in New Issue