WordPress.org

Make WordPress Core

Ticket #33552: 33552.diff

File 33552.diff, 1.5 KB (added by westonruter, 5 years ago)
  • src/wp-includes/class-wp-customize-manager.php

    diff --git src/wp-includes/class-wp-customize-manager.php src/wp-includes/class-wp-customize-manager.php
    index 9cac338..927181b 100644
    final class WP_Customize_Manager { 
    110110                require_once( ABSPATH . WPINC . '/class-wp-customize-panel.php' );
    111111                require_once( ABSPATH . WPINC . '/class-wp-customize-section.php' );
    112112                require_once( ABSPATH . WPINC . '/class-wp-customize-control.php' );
    113                 require_once( ABSPATH . WPINC . '/class-wp-customize-widgets.php' );
    114                 require_once( ABSPATH . WPINC . '/class-wp-customize-nav-menus.php' );
    115113
    116                 $this->widgets = new WP_Customize_Widgets( $this );
    117                 $this->nav_menus = new WP_Customize_Nav_Menus( $this );
     114                /**
     115                 * Fires at the beginning of WP_Customize_Manager's constructor.
     116                 *
     117                 * Allows plugins to add/override Customizer features.
     118                 *
     119                 * @see WP_Customize_Manager::__construct().
     120                 * @since 4.4.0
     121                 *
     122                 * @param WP_Customize_Manager $this WP_Customize_Manager instance.
     123                 */
     124                do_action( 'customize_manager_construct', $this );
     125
     126                if ( ! isset( $this->widgets ) ) {
     127                        require_once( ABSPATH . WPINC . '/class-wp-customize-widgets.php' );
     128                        $this->widgets = new WP_Customize_Widgets( $this );
     129                }
     130
     131                if ( ! isset( $this->nav_menus ) ) {
     132                        require_once( ABSPATH . WPINC . '/class-wp-customize-nav-menus.php' );
     133                        $this->nav_menus = new WP_Customize_Nav_Menus( $this );
     134                }
    118135
    119136                add_filter( 'wp_die_handler', array( $this, 'wp_die_handler' ) );
    120137