mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Customizer: Improve ability to filter active state for widget area Customizer sections.
* Mark panels, sections, controls as active if preview explicitly indicates. * Introduce `WP_Customize_Sidebar_Section` PHP class, and `SidebarSection` JS class. * Move logic for determining whether a sidebar section is active from the `SidebarControl` to `SidebarSection`. props westonruter. fixes #30235. git-svn-id: https://develop.svn.wordpress.org/trunk@30329 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -468,6 +468,7 @@ final class WP_Customize_Widgets {
|
||||
'description' => $GLOBALS['wp_registered_sidebars'][ $sidebar_id ]['description'],
|
||||
'priority' => array_search( $sidebar_id, array_keys( $wp_registered_sidebars ) ),
|
||||
'panel' => 'widgets',
|
||||
'sidebar_id' => $sidebar_id,
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -481,7 +482,8 @@ final class WP_Customize_Widgets {
|
||||
*/
|
||||
$section_args = apply_filters( 'customizer_widgets_section_args', $section_args, $section_id, $sidebar_id );
|
||||
|
||||
$this->manager->add_section( $section_id, $section_args );
|
||||
$section = new WP_Customize_Sidebar_Section( $this->manager, $section_id, $section_args );
|
||||
$this->manager->add_section( $section );
|
||||
|
||||
$control = new WP_Widget_Area_Customize_Control( $this->manager, $setting_id, array(
|
||||
'section' => $section_id,
|
||||
|
||||
Reference in New Issue
Block a user