[wp-trac] [WordPress Trac] #36964: Show/hide the tag-cloud on `edit-tags.php` admin pages using a filter
WordPress Trac
noreply at wordpress.org
Fri Nov 18 09:12:44 UTC 2016
#36964: Show/hide the tag-cloud on `edit-tags.php` admin pages using a filter
----------------------------+---------------------------------
Reporter: ramiy | Owner: helen
Type: enhancement | Status: closed
Priority: normal | Milestone: 4.7
Component: Administration | Version:
Severity: normal | Resolution: fixed
Keywords: has-patch | Focuses: ui, administration
----------------------------+---------------------------------
Comment (by SergeyBiryukov):
If someone wants to restore the tag cloud, `add_tag_form` action can be
used for that:
{{{
function wp36964_restore_tag_cloud_on_tags_screen() {
global $taxnow, $taxonomy, $post_type;
$tax = get_taxonomy( $taxnow );
if ( ! is_null( $tax->labels->popular_items ) ) {
if ( current_user_can( $tax->cap->edit_terms ) ) {
$tag_cloud = wp_tag_cloud( array( 'taxonomy' =>
$taxonomy, 'post_type' => $post_type, 'echo' => false, 'link' => 'edit' )
);
} else {
$tag_cloud = wp_tag_cloud( array( 'taxonomy' =>
$taxonomy, 'echo' => false ) );
}
if ( $tag_cloud ) : ?>
<div class="tagcloud">
<h2><?php echo
$tax->labels->popular_items; ?></h2>
<?php echo $tag_cloud; ?>
</div>
<?php
endif;
}
}
add_action( 'add_tag_form', 'wp36964_restore_tag_cloud_on_tags_screen' );
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/36964#comment:25>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list