Switch language

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




wp_ajax_get_tagcloud [ WordPress Function ]

wp_ajax_get_tagcloud ( No parameters )
Defined at:



No description yet.

Source


<?php
function wp_ajax_get_tagcloud() {
    if ( isset( 
$_POST['tax'] ) ) {
        
$taxonomy sanitize_key$_POST['tax'] );
        
$tax get_taxonomy$taxonomy );
        if ( ! 
$tax )
            
wp_die);
        if ( ! 
current_user_can$tax->cap->assign_terms ) )
            
wp_die( -);
    } else {
        
wp_die);
    }

    
$tags get_terms$taxonomy, array( 'number' => 45'orderby' => 'count''order' => 'DESC' ) );

    if ( empty( 
$tags ) )
        
wp_die( isset( $tax->no_tagcloud ) ? $tax->no_tagcloud __('No tags found!') );

    if ( 
is_wp_error$tags ) )
        
wp_die$tags->get_error_message() );

    foreach ( 
$tags as $key => $tag ) {
        
$tags$key ]->link '#';
        
$tags$key ]->id $tag->term_id;
    }

    
// We need raw tag names here, so don't filter the output
    
$return wp_generate_tag_cloud$tags, array('filter' => 0) );

    if ( empty(
$return) )
        
wp_die);

    echo 
$return;

    
wp_die();
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



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