WordPress.org

Make WordPress Core

Changeset 25452


Ignore:
Timestamp:
09/16/2013 05:50:16 PM (8 years ago)
Author:
nacin
Message:

Use get_terms() in the ajax tag search.

props Chouby.
fixes #25231.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/ajax-actions.php

    r25438 r25452  
    8888        wp_die(); // require 2 chars for matching
    8989
    90     $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 ) . '%' ) );
     90    $results = get_terms( $taxonomy, array( 'name__like' => $s, 'fields' => 'names', 'hide_empty' => false ) );
    9191
    9292    echo join( $results, "\n" );
Note: See TracChangeset for help on using the changeset viewer.