WordPress.org

Make WordPress Core

Ticket #10516: 10516.diff

File 10516.diff, 850 bytes (added by dcole07, 5 years ago)

Allows links to pick which sidebar is open

  • wp-admin/widgets.php

     
    368368foreach ( $wp_registered_sidebars as $sidebar => $registered_sidebar ) { 
    369369        if ( 'wp_inactive_widgets' == $sidebar ) 
    370370                continue; 
    371         $closed = $i ? ' closed' : ''; ?> 
    372         <div class="widgets-holder-wrap<?php echo $closed; ?>"> 
     371        if (empty($_GET['sidebar'])) { 
     372                $closed = $i ? ' closed' : ''; 
     373        } 
     374        else { 
     375                $closed = ' closed'; 
     376        } ?> 
     377        <div class="widgets-holder-wrap<?php echo (!empty($_GET['sidebar']) && ( $sidebar == $_GET['sidebar'] || $registered_sidebar['name'] == $_GET['sidebar'] )) ? '' : $closed; ?>"> 
    373378        <div class="sidebar-name"> 
    374379        <div class="sidebar-name-arrow"><br /></div> 
    375380        <h3><?php echo esc_html( $registered_sidebar['name'] ); ?>