Make WordPress Core


Ignore:
Timestamp:
11/13/2014 12:18:01 PM (10 years ago)
Author:
ocean90
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-widgets.php

    r30055 r30329  
    469469                        'priority' => array_search( $sidebar_id, array_keys( $wp_registered_sidebars ) ),
    470470                        'panel' => 'widgets',
     471                        'sidebar_id' => $sidebar_id,
    471472                    );
    472473
     
    482483                    $section_args = apply_filters( 'customizer_widgets_section_args', $section_args, $section_id, $sidebar_id );
    483484
    484                     $this->manager->add_section( $section_id, $section_args );
     485                    $section = new WP_Customize_Sidebar_Section( $this->manager, $section_id, $section_args );
     486                    $this->manager->add_section( $section );
    485487
    486488                    $control = new WP_Widget_Area_Customize_Control( $this->manager, $setting_id, array(
Note: See TracChangeset for help on using the changeset viewer.