Make WordPress Core


Ignore:
Timestamp:
04/07/2017 07:26:31 PM (8 years ago)
Author:
westonruter
Message:

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.

File:
1 edited

Legend:

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

    r38470 r40395  
    105105
    106106    /**
     107     * Auto-expand a section in a panel when the panel is expanded when the panel only has the one section.
     108     *
     109     * @since 4.7.4
     110     * @access public
     111     * @var bool
     112     */
     113    public $auto_expand_sole_section = false;
     114
     115    /**
    107116     * Customizer sections for this panel.
    108117     *
     
    220229        $array['active'] = $this->active();
    221230        $array['instanceNumber'] = $this->instance_number;
     231        $array['autoExpandSoleSection'] = $this->auto_expand_sole_section;
    222232        return $array;
    223233    }
Note: See TracChangeset for help on using the changeset viewer.