Ticket #35354: 35354.diff
File 35354.diff, 1.9 KB (added by , 9 years ago) |
---|
-
src/wp-includes/class-wp-customize-manager.php
94 94 protected $panels = array(); 95 95 96 96 /** 97 * List of core components. 98 * 99 * @since 4.5.0 100 * @access protected 101 * @var array 102 */ 103 protected $components = array(); 104 105 /** 97 106 * Registered instances of WP_Customize_Section. 98 107 * 99 108 * @since 3.4.0 … … 223 232 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-item-setting.php' ); 224 233 require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-setting.php' ); 225 234 235 // Core components. 236 $this->components = array( 'widgets', 'nav_menus' ); 237 226 238 /** 227 239 * Filter the core Customizer components to load. 228 240 * … … 238 250 * @param array $components List of core components to load. 239 251 * @param WP_Customize_Manager $this WP_Customize_Manager instance. 240 252 */ 241 $components = apply_filters( 'customize_loaded_components', array( 'widgets', 'nav_menus' ), $this );253 $components = apply_filters( 'customize_loaded_components', $this->components, $this ); 242 254 243 255 if ( in_array( 'widgets', $components ) ) { 244 256 require_once( ABSPATH . WPINC . '/class-wp-customize-widgets.php' ); … … 1198 1210 * @param string $id Panel ID to remove. 1199 1211 */ 1200 1212 public function remove_panel( $id ) { 1201 $core_panels = array( 1202 'widgets', 1203 'nav_menus', 1204 ); 1205 1206 if ( in_array( $id, $core_panels, true ) ) { 1213 // Removing core components this way is _doing_it_wrong(). 1214 if ( in_array( $id, $this->components, true ) ) { 1207 1215 /* translators: 1: panel id, 2: filter reference URL, 3: filter name */ 1208 1216 $message = sprintf( __( 'Removing %1$s manually will cause PHP warnings. Use the <a href="%2$s">%3$s</a> filter instead.' ), 1209 1217 $id,