From d884ee49f867c01367015257e9427c83a08d8bc7 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 12 Nov 2008 05:02:58 +0000 Subject: [PATCH] Limit tag suggest to tags. Props DD32. fixes #8164 git-svn-id: https://develop.svn.wordpress.org/trunk@9629 602fd350-edb4-49c9-b593-d223f7449a82 --- 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;