Make WordPress Core

Changeset 36369


Ignore:
Timestamp:
01/20/2016 09:56:44 PM (9 years ago)
Author:
ocean90
Message:

Widgets: Show the "Clear Inactive Widgets" button only after the sidebar with inactive widgets.

Merges [36326] to the 4.4 branch.
See #35447.

Location:
branches/4.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.4

  • branches/4.4/src/wp-admin/widgets.php

    r35317 r36369  
    407407            $wrap_class .= ' ' . $registered_sidebar['class'];
    408408
     409        $is_inactive_widgets = 'wp_inactive_widgets' == $registered_sidebar['id'];
    409410        ?>
    410411        <div class="<?php echo esc_attr( $wrap_class ); ?>">
    411412            <div class="widget-holder inactive">
    412413                <?php wp_list_widget_controls( $registered_sidebar['id'], $registered_sidebar['name'] ); ?>
     414
     415                <?php if ( $is_inactive_widgets ) { ?>
    413416                <div class="remove-inactive-widgets">
    414417                    <form action="" method="post">
     
    428431                    </form>
    429432                </div>
     433                <?php } ?>
    430434            </div>
     435            <?php if ( $is_inactive_widgets ) { ?>
    431436            <p class="description"><?php _e( 'This will clear all items from the inactive widgets list. You will not be able to restore any customizations.' ); ?></p>
     437            <?php } ?>
    432438        </div>
    433439        <?php
Note: See TracChangeset for help on using the changeset viewer.