Make WordPress Core

Ticket #36964: 36964.patch

File 36964.patch, 1.4 KB (added by ramiy, 8 years ago)
  • wp-admin/edit-tags.php

     
    533533</form></div>
    534534<?php }
    535535
    536 if ( ! is_null( $tax->labels->popular_items ) ) {
     536$show_admin_popular_items = ! is_null( $tax->labels->popular_items );
     537
     538/**
     539 * Filters whether to show the popular items tag cloud in the taxonomy admin screen.
     540 *
     541 * This filter controls the visibility of the popular items tag cloud in the
     542 * taxonomy admin screen.
     543 *
     544 * By default, the tag cloud is visible on non-hierarchy taxonomies admin pages.
     545 * You can hide it using `__return_false`.
     546 *
     547 * @since 4.6.0
     548 *
     549 * @param bool $show_admin_popular_items Whether to show the popular items tag cloud.
     550 */
     551if ( apply_filters( 'show_admin_popular_items_tag_cloud', $show_admin_popular_items ) ) {
    537552        if ( current_user_can( $tax->cap->edit_terms ) ) {
    538553                $tag_cloud = wp_tag_cloud( array( 'taxonomy' => $taxonomy, 'post_type' => $post_type, 'echo' => false, 'link' => 'edit' ) );
    539554        } else {
     
    540555                $tag_cloud = wp_tag_cloud( array( 'taxonomy' => $taxonomy, 'echo' => false ) );
    541556        }
    542557
    543         if ( $tag_cloud ) :
    544         ?>
     558        if ( $tag_cloud ) {
     559?>
    545560<div class="tagcloud">
    546561<h2><?php echo $tax->labels->popular_items; ?></h2>
    547562<?php echo $tag_cloud; unset( $tag_cloud ); ?>
    548563</div>
    549564<?php
    550         endif;
     565        }
    551566}
    552567
    553568?>