Customize: Auto-expand a widget area section when expanding the Widgets panel if there is only one registered sidebar and it is active.

Introduces `WP_Customize_Panel::$auto_expand_sole_section` property which allows panels to opt-in to the behavior, which the Widgets panel is made to do by default.

Props delawski, westonruter, melchoyce.
Fixes #37471.


git-svn-id: https://develop.svn.wordpress.org/trunk@40395 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Weston Ruter
2017-04-07 19:26:31 +00:00
parent f44a9eba4e
commit e896940a4e
4 changed files with 72 additions and 25 deletions
@@ -422,6 +422,7 @@ final class WP_Customize_Widgets {
'description' => __( 'Widgets are independent sections of content that can be placed into widgetized areas provided by your theme (commonly called sidebars).' ),
'priority' => 110,
'active_callback' => array( $this, 'is_panel_active' ),
'auto_expand_sole_section' => true,
) );
foreach ( $sidebars_widgets as $sidebar_id => $sidebar_widget_ids ) {