Customizer: Allow sections and panels to be exported to JS.

Also fix param docs for `customize_dynamic_setting_class` filter, and use `require_once` for `class-wp-customize-manager.php` in bootstrap function `_wp_customize_include()`.

See #30737, #32576.


git-svn-id: https://develop.svn.wordpress.org/trunk@32744 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Weston Ruter 2015-06-12 22:53:39 +00:00
parent 4092c5a37e
commit 0c7358cffc
2 changed files with 5 additions and 6 deletions

View File

@ -909,7 +909,7 @@ final class WP_Customize_Manager {
*
* @param string $setting_class WP_Customize_Setting or a subclass.
* @param string $setting_id ID for dynamic setting, usually coming from `$_POST['customized']`.
* @param string $setting_args WP_Customize_Setting or a subclass.
* @param array $setting_args WP_Customize_Setting or a subclass.
*/
$setting_class = apply_filters( 'customize_dynamic_setting_class', $setting_class, $setting_id, $setting_args );
@ -1205,7 +1205,7 @@ final class WP_Customize_Manager {
$sections = array();
foreach ( $this->sections as $section ) {
if ( ! $section->check_capabilities() || ! $section->controls ) {
if ( ! $section->check_capabilities() ) {
continue;
}
@ -1228,7 +1228,7 @@ final class WP_Customize_Manager {
$panels = array();
foreach ( $this->panels as $panel ) {
if ( ! $panel->check_capabilities() || ! $panel->sections ) {
if ( ! $panel->check_capabilities() ) {
continue;
}

View File

@ -1992,9 +1992,8 @@ function _wp_customize_include() {
) )
return;
require( ABSPATH . WPINC . '/class-wp-customize-manager.php' );
// Init Customize class
$GLOBALS['wp_customize'] = new WP_Customize_Manager;
require_once ABSPATH . WPINC . '/class-wp-customize-manager.php';
$GLOBALS['wp_customize'] = new WP_Customize_Manager();
}
/**