Make WordPress Core


Ignore:
Timestamp:
01/20/2016 09:54:01 PM (11 years ago)
Author:
ocean90
Message:

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

Fixes #35447.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/widgets.php

    r36001 r36368  
    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.