Add taxonomy argument to wp_tag_cloud()
git-svn-id: http://svn.automattic.com/wordpress/trunk@10554 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
7bb01e4c48
commit
57c3eba439
|
@ -244,9 +244,9 @@ if ( $page_links )
|
|||
<h3><?php _e('Popular Tags'); ?></h3>
|
||||
<?php
|
||||
if ( $can_manage )
|
||||
wp_tag_cloud(array('link' => 'edit'));
|
||||
wp_tag_cloud(array('taxonomy' => $taxonomy, 'link' => 'edit'));
|
||||
else
|
||||
wp_tag_cloud();
|
||||
wp_tag_cloud(array('taxonomy' => $taxonomy));
|
||||
?>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -560,20 +560,20 @@ function wp_tag_cloud( $args = '' ) {
|
|||
$defaults = array(
|
||||
'smallest' => 8, 'largest' => 22, 'unit' => 'pt', 'number' => 45,
|
||||
'format' => 'flat', 'orderby' => 'name', 'order' => 'ASC',
|
||||
'exclude' => '', 'include' => '', 'link' => 'view'
|
||||
'exclude' => '', 'include' => '', 'link' => 'view', 'taxonomy' => 'post_tag'
|
||||
);
|
||||
$args = wp_parse_args( $args, $defaults );
|
||||
|
||||
$tags = get_tags( array_merge( $args, array( 'orderby' => 'count', 'order' => 'DESC' ) ) ); // Always query top tags
|
||||
$tags = get_terms( $args['taxonomy'], array_merge( $args, array( 'orderby' => 'count', 'order' => 'DESC' ) ) ); // Always query top tags
|
||||
|
||||
if ( empty( $tags ) )
|
||||
return;
|
||||
|
||||
foreach ( $tags as $key => $tag ) {
|
||||
if ( 'edit' == $args['link'] )
|
||||
$link = get_edit_tag_link( $tag->term_id );
|
||||
$link = get_edit_tag_link( $tag->term_id, $args['taxonomy'] );
|
||||
else
|
||||
$link = get_tag_link( $tag->term_id );
|
||||
$link = get_term_link( $tag->term_id, $args['taxonomy'] );
|
||||
if ( is_wp_error( $link ) )
|
||||
return false;
|
||||
|
||||
|
|
|
@ -575,7 +575,7 @@ function get_tag_feed_link($tag_id, $feed = '') {
|
|||
* @return string
|
||||
*/
|
||||
function get_edit_tag_link( $tag_id = 0, $taxonomy = 'post_tag' ) {
|
||||
$tag = get_term($tag_id, 'post_tag');
|
||||
$tag = get_term($tag_id, $taxonomy);
|
||||
|
||||
if ( !current_user_can('manage_categories') )
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue