WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/11/2009 11:41:29 PM (11 years ago)
Author:
ryan
Message:

Add taxonomy argument to wp_tag_cloud()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/category-template.php

    r10316 r10554  
    561561        'smallest' => 8, 'largest' => 22, 'unit' => 'pt', 'number' => 45,
    562562        'format' => 'flat', 'orderby' => 'name', 'order' => 'ASC',
    563         'exclude' => '', 'include' => '', 'link' => 'view'
     563        'exclude' => '', 'include' => '', 'link' => 'view', 'taxonomy' => 'post_tag'
    564564    );
    565565    $args = wp_parse_args( $args, $defaults );
    566566
    567     $tags = get_tags( array_merge( $args, array( 'orderby' => 'count', 'order' => 'DESC' ) ) ); // Always query top tags
     567    $tags = get_terms( $args['taxonomy'], array_merge( $args, array( 'orderby' => 'count', 'order' => 'DESC' ) ) ); // Always query top tags
    568568
    569569    if ( empty( $tags ) )
     
    572572    foreach ( $tags as $key => $tag ) {
    573573        if ( 'edit' == $args['link'] )
    574             $link = get_edit_tag_link( $tag->term_id );
     574            $link = get_edit_tag_link( $tag->term_id, $args['taxonomy'] );
    575575        else
    576             $link = get_tag_link( $tag->term_id );
     576            $link = get_term_link( $tag->term_id, $args['taxonomy'] );
    577577        if ( is_wp_error( $link ) )
    578578            return false;
Note: See TracChangeset for help on using the changeset viewer.