Only show "Popular Terms" header when there is a tag cloud to show. see #11838

git-svn-id: http://svn.automattic.com/wordpress/trunk@13160 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2010-02-15 09:05:56 +00:00
parent dfe271c71b
commit 6597e399cc
1 changed files with 11 additions and 7 deletions

View File

@ -302,17 +302,21 @@ if ( $page_links )
<div id="col-left">
<div class="col-wrap">
<div class="tagcloud">
<h3><?php printf(_x('Popular %s', '%s: plural taxonomy name'), $tax->label); ?></h3>
<?php
if ( current_user_can( $tax->edit_cap ) )
wp_tag_cloud(array('taxonomy' => $taxonomy, 'link' => 'edit'));
$tag_cloud = wp_tag_cloud( array( 'taxonomy' => $taxonomy, 'echo' => false, 'link' => 'edit' ) );
else
wp_tag_cloud(array('taxonomy' => $taxonomy));
?>
</div>
$tag_cloud = wp_tag_cloud( array( 'taxonomy' => $taxonomy, 'echo' => false ) );
if ( $tag_cloud ) :
?>
<div class="tagcloud">
<h3><?php printf(_x('Popular %s', '%s: plural taxonomy name'), $tax->label); ?></h3>
<?php echo $tag_cloud; unset( $tag_cloud ); ?>
</div>
<?php
endif;
if ( current_user_can($tax->edit_cap) ) {
if ( 'category' == $taxonomy )
do_action('add_category_form_pre', (object)array('parent' => 0) ); // Back compat hook. Deprecated in preference to $taxonomy_pre_add_form