Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




wp_ajax_ajax_tag_search [ WordPress Function ]

wp_ajax_ajax_tag_search ( No parameters )
Defined at:



No description yet.

Source


<?php
function wp_ajax_ajax_tag_search() {
    global 
$wpdb;

    if ( isset( 
$_GET['tax'] ) ) {
        
$taxonomy sanitize_key$_GET['tax'] );
        
$tax get_taxonomy$taxonomy );
        if ( ! 
$tax )
            
wp_die);
        if ( ! 
current_user_can$tax->cap->assign_terms ) )
            
wp_die( -);
    } else {
        
wp_die);
    }

    
$s stripslashes$_GET['q'] );

    
$comma _x',''tag delimiter' );
    if ( 
',' !== $comma )
        
$s str_replace$comma','$s );
    if ( 
false !== strpos$s',' ) ) {
        
$s explode','$s );
        
$s $s[count$s ) - 1];
    }
    
$s trim$s );
    if ( 
strlen$s ) < )
        
wp_die(); // require 2 chars for matching

    
$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 ) . '%' ) );

    echo 
join$results"\n" );
    
wp_die();
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics