WordPress.org

Make WordPress Core

Ticket #17979: 17979.10.diff

File 17979.10.diff, 6.2 KB (added by aaroncampbell, 7 years ago)

Moves orphaned widgets to main content area above inactive widgets

  • wp-admin/css/wp-admin-rtl.dev.css

     
    21602160        clear: left;
    21612161}
    21622162
    2163 #wp_inactive_widgets .widget {
     2163.sidebar-inactive .widget {
    21642164        float: right;
    21652165}
    21662166
     
    21722172        float: right;
    21732173}
    21742174
    2175 #wp_inactive_widgets .widget-placeholder {
     2175.sidebar-inactive .widget-placeholder {
    21762176        float: right;
    21772177}
    21782178
     
    21882188.sidebar-name-arrow {
    21892189        float: left;
    21902190}
    2191 
    2192 
  • wp-admin/css/wp-admin.dev.css

     
    72847284        width: 300px;
    72857285}
    72867286
     7287.sidebar-inactive .sidebar-description {
     7288        padding:15px 15px 10px 15px;
     7289}
     7290
    72877291.widget-liquid-right .widget,
    7288 #wp_inactive_widgets .widget,
     7292.sidebar-inactive .widget,
    72897293.widget-liquid-right .sidebar-description {
    72907294        width: 250px;
    72917295        margin: 0 auto 20px;
    72927296        overflow: hidden;
    72937297}
    72947298
     7299.sidebar-inactive .sidebar-name,
     7300.sidebar-inactive .sidebar-description {
     7301        opacity: 0.5;
     7302}
     7303
     7304
    72957305.widget-liquid-right .sidebar-description {
    72967306        margin-bottom: 10px;
    72977307}
    72987308
    7299 #wp_inactive_widgets .widget {
     7309.sidebar-inactive .widget {
    73007310        margin: 0 10px 20px;
    73017311        float: left;
    73027312}
     
    73707380        box-shadow: none;
    73717381}
    73727382
    7373 #wp_inactive_widgets {
     7383.sidebar-inactive {
    73747384        padding: 5px 5px 0;
    73757385}
    73767386
     
    74037413        width: 250px;
    74047414}
    74057415
    7406 #wp_inactive_widgets .widget-placeholder {
     7416.sidebar-inactive .widget-placeholder {
    74077417        margin: 0 10px 20px;
    74087418        float: left;
    74097419}
     
    75427552
    75437553#available-widgets .widget-control-edit .add,
    75447554#widgets-right .widget-control-edit .edit,
    7545 #wp_inactive_widgets .widget-control-edit .edit {
     7555.sidebar-inactive .widget-control-edit .edit {
    75467556        display: inline;
    75477557}
    75487558
     
    76367646.widgets_access .widget .widget-top {
    76377647        cursor: default;
    76387648}
    7639 
  • wp-admin/css/ie.dev.css

     
    408408        width: 99%;
    409409}
    410410
    411 #wp_inactive_widgets {
     411.sidebar-inactive .widgets-sortables {
    412412        padding-bottom: 8px;
    413413}
    414414
     
    437437}
    438438
    439439.widget-liquid-right .widget,
    440 #wp_inactive_widgets .widget {
     440.sidebar-inactive .widget {
    441441        position: relative;
    442442}
    443443
  • wp-admin/widgets.php

     
    5050if ( empty( $sidebars_widgets ) )
    5151        $sidebars_widgets = wp_get_widget_defaults();
    5252
    53 // register the inactive_widgets area as sidebar
    54 register_sidebar(array(
    55         'name' => __('Inactive Widgets'),
    56         'id' => 'wp_inactive_widgets',
    57         'class' => 'inactive',
    58         'description' => '',
    59         'before_widget' => '',
    60         'after_widget' => '',
    61         'before_title' => '',
    62         'after_title' => '',
    63 ));
     53foreach ( $sidebars_widgets as $sidebar_id => $widgets ) {
     54        if ( 'wp_inactive_widgets' == $sidebar_id )
     55                continue;
    6456
    65 foreach ( $sidebars_widgets as $sidebar_id => $widgets ) {
    6657        if ( empty( $wp_registered_sidebars[ $sidebar_id ] ) && ! empty( $widgets ) ) {
    6758                // register the inactive_widgets area as sidebar
    6859                register_sidebar(array(
    6960                        'name' => __( 'Inactive Widgets (Previous Theme)' ),
    7061                        'id' => $sidebar_id,
    71                         'class' => 'orphaned',
     62                        'class' => 'inactive',
    7263                        'description' => __( 'This is a left over sidebar from an old theme and does not show anywhere on your site' ),
    7364                        'before_widget' => '',
    7465                        'after_widget' => '',
     
    7869        }
    7970}
    8071
     72// register the inactive_widgets area as sidebar
     73register_sidebar(array(
     74        'name' => __('Inactive Widgets'),
     75        'id' => 'wp_inactive_widgets',
     76        'class' => 'inactive',
     77        'description' => 'Drag widgets here to remove them from the sidebar but keep their settings.',
     78        'before_widget' => '',
     79        'after_widget' => '',
     80        'before_title' => '',
     81        'after_title' => '',
     82));
     83
    8184retrieve_widgets();
    8285
    8386if ( count($wp_registered_sidebars) == 1 ) {
     
    228231<?php
    229232        foreach ( $wp_registered_sidebars as $sbname => $sbvalue ) {
    230233                echo "\t\t<tr><td><label><input type='radio' name='sidebar' value='" . esc_attr($sbname) . "'" . checked( $sbname, $sidebar, false ) . " /> $sbvalue[name]</label></td><td>";
    231                 if ( 'wp_inactive_widgets' == $sbname ) {
     234                if ( 'wp_inactive_widgets' == $sbname || 'orphaned_widgets' == substr( $sbname, 0, 16 ) ) {
    232235                        echo '&nbsp;';
    233236                } else {
    234237                        if ( !isset($sidebars_widgets[$sbname]) || !is_array($sidebars_widgets[$sbname]) ) {
     
    317320                <br class="clear" />
    318321        </div>
    319322
    320         <div class="widgets-holder-wrap">
    321                 <div class="sidebar-name">
    322                 <div class="sidebar-name-arrow"><br /></div>
    323                 <h3><?php _e('Inactive Widgets'); ?>
    324                 <span><img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-feedback" title="" alt="" /></span></h3></div>
    325                 <div class="widget-holder inactive">
    326                 <p class="description"><?php _e('Drag widgets here to remove them from the sidebar but keep their settings.'); ?></p>
    327                 <?php wp_list_widget_controls('wp_inactive_widgets'); ?>
    328                 <br class="clear" />
     323<?php
     324foreach ( $wp_registered_sidebars as $sidebar => $registered_sidebar ) {
     325        if ( 'wp_inactive_widgets' == $sidebar || 'orphaned_widgets' == substr( $sidebar, 0, 16 ) ) {
     326                $wrap_class = 'widgets-holder-wrap';
     327                if ( !empty( $registered_sidebar['class'] ) )
     328                        $wrap_class .= ' sidebar-' . $registered_sidebar['class'];
     329
     330?>
     331
     332                <div class="<?php esc_attr_e( $wrap_class ); ?>">
     333                        <div class="sidebar-name">
     334                                <div class="sidebar-name-arrow"><br /></div>
     335                                <h3><?php esc_html_e( $registered_sidebar['name'] ); ?>
     336                                        <span><img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-feedback" title="" alt="" /></span>
     337                                </h3>
     338                        </div>
     339                                <?php wp_list_widget_controls( $registered_sidebar['id'] ); ?>
     340                                <br class="clear" />
    329341                </div>
    330         </div>
     342<?php
     343        }
     344}
     345?>
     346
    331347</div>
    332348</div>
    333349
     
    336352<?php
    337353$i = 0;
    338354foreach ( $wp_registered_sidebars as $sidebar => $registered_sidebar ) {
    339         if ( 'wp_inactive_widgets' == $sidebar )
     355        if ( 'wp_inactive_widgets' == $sidebar || 'orphaned_widgets' == substr( $sidebar, 0, 16 ) )
    340356                continue;
    341357
    342358        $wrap_class = 'widgets-holder-wrap';