From e09057ce2ef01ff627634e1b597ad87b33002b80 Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 12 Nov 2008 05:02:58 +0000 Subject: [PATCH] Limit tag suggest to tags. Props DD32. fixes #8164 git-svn-id: http://svn.automattic.com/wordpress/trunk@9629 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/admin-ajax.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-admin/admin-ajax.php b/wp-admin/admin-ajax.php index aa5b6f3b0c..86f28d96c2 100644 --- a/wp-admin/admin-ajax.php +++ b/wp-admin/admin-ajax.php @@ -51,8 +51,8 @@ case 'ajax-tag-search' : } $s = trim( $s ); if ( strlen( $s ) < 2 ) - die; // require 2 chars for matching - $results = $wpdb->get_col( "SELECT name FROM $wpdb->terms WHERE name LIKE ('%". $s . "%')" ); + die; // require 2 chars for matching + $results = $wpdb->get_col( "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 = 'post_tag' AND t.name LIKE ('%". $s . "%')" ); echo join( $results, "\n" ); die; break;