From 188f7631201c9178cffb560ace484431b9ab086a Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Mon, 16 Sep 2013 17:51:08 +0000 Subject: [PATCH] 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 --- wp-admin/includes/ajax-actions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-admin/includes/ajax-actions.php b/wp-admin/includes/ajax-actions.php index 6799c4409c..f73935022c 100644 --- a/wp-admin/includes/ajax-actions.php +++ b/wp-admin/includes/ajax-actions.php @@ -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();