WordPress.org

Make WordPress Core

Ticket #25231: 25231.patch

File 25231.patch, 709 bytes (added by Chouby, 8 years ago)
  • wp-admin/includes/ajax-actions.php

     
    8787        if ( strlen( $s ) < 2 )
    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" );
    9393        wp_die();