Make WordPress Core


Ignore:
Timestamp:
01/03/2008 01:34:11 AM (16 years ago)
Author:
matt
Message:

New tag interface, tag auto-suggest while typing. Rough - suggest and parts of JS should probably be refactored. Hat tip: jhodgdon.

File:
1 edited

Legend:

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

    r6373 r6542  
    77if ( !is_user_logged_in() )
    88    die('-1');
     9
     10if ( 'ajax-tag-search' == $_GET['action'] ) {
     11    if ( !current_user_can( 'manage_categories' ) )
     12        die('-1');
     13
     14    $s = $_GET['q']; // is this slashed already?
     15
     16    if ( strstr( $s, ',' ) )
     17        die; // it's a multiple tag insert, we won't find anything
     18    $results = $wpdb->get_col( "SELECT name FROM $wpdb->terms WHERE name LIKE ('%$s%')" );
     19    echo join( $results, "\n" );
     20    die;
     21}
    922
    1023function get_out_now() { exit; }
Note: See TracChangeset for help on using the changeset viewer.