Make WordPress Core


Ignore:
Timestamp:
10/25/2017 09:44:48 PM (8 years ago)
Author:
westonruter
Message:

Customize: Register the Publish Settings section in JS to ensure it does not get unregistered via PHP.

The publish_settings section is a fundamental dependency for Customizer, so it must be guaranteed to be registered.

Also unconditionally register core types for panels, sections, and controls in case plugin unhooks all customize_register actions.

See #39896.
Fixes #42337.

File:
1 edited

Legend:

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

    r42006 r42025  
    891891     */
    892892    public function wp_loaded() {
     893
     894        // Unconditionally register core types for panels, sections, and controls in case plugin unhooks all customize_register actions.
     895        $this->register_panel_type( 'WP_Customize_Panel' );
     896        $this->register_panel_type( 'WP_Customize_Themes_Panel' );
     897        $this->register_section_type( 'WP_Customize_Section' );
     898        $this->register_section_type( 'WP_Customize_Sidebar_Section' );
     899        $this->register_section_type( 'WP_Customize_Themes_Section' );
     900        $this->register_control_type( 'WP_Customize_Color_Control' );
     901        $this->register_control_type( 'WP_Customize_Media_Control' );
     902        $this->register_control_type( 'WP_Customize_Upload_Control' );
     903        $this->register_control_type( 'WP_Customize_Image_Control' );
     904        $this->register_control_type( 'WP_Customize_Background_Image_Control' );
     905        $this->register_control_type( 'WP_Customize_Background_Position_Control' );
     906        $this->register_control_type( 'WP_Customize_Cropped_Image_Control' );
     907        $this->register_control_type( 'WP_Customize_Site_Icon_Control' );
     908        $this->register_control_type( 'WP_Customize_Theme_Control' );
     909        $this->register_control_type( 'WP_Customize_Code_Editor_Control' );
     910        $this->register_control_type( 'WP_Customize_Date_Time_Control' );
    893911
    894912        /**
     
    47274745    public function register_controls() {
    47284746
    4729         /* Panel, Section, and Control Types */
    4730         $this->register_panel_type( 'WP_Customize_Panel' );
    4731         $this->register_panel_type( 'WP_Customize_Themes_Panel' );
    4732         $this->register_section_type( 'WP_Customize_Section' );
    4733         $this->register_section_type( 'WP_Customize_Sidebar_Section' );
    4734         $this->register_section_type( 'WP_Customize_Themes_Section' );
    4735         $this->register_control_type( 'WP_Customize_Color_Control' );
    4736         $this->register_control_type( 'WP_Customize_Media_Control' );
    4737         $this->register_control_type( 'WP_Customize_Upload_Control' );
    4738         $this->register_control_type( 'WP_Customize_Image_Control' );
    4739         $this->register_control_type( 'WP_Customize_Background_Image_Control' );
    4740         $this->register_control_type( 'WP_Customize_Background_Position_Control' );
    4741         $this->register_control_type( 'WP_Customize_Cropped_Image_Control' );
    4742         $this->register_control_type( 'WP_Customize_Site_Icon_Control' );
    4743         $this->register_control_type( 'WP_Customize_Theme_Control' );
    4744         $this->register_control_type( 'WP_Customize_Code_Editor_Control' );
    4745         $this->register_control_type( 'WP_Customize_Date_Time_Control' );
    4746 
    4747         /* Publish Settings */
    4748 
    4749         // Note the controls for this section are added via JS.
    4750         $this->add_section( 'publish_settings', array(
    4751             'title' => __( 'Publish Settings' ),
    4752             'priority' => 0,
    4753             'capability' => 'customize',
    4754             'type' => 'outer',
    4755             'active_callback' => array( $this, 'is_theme_active' ),
    4756         ) );
    4757 
    47584747        /* Themes (controls are loaded via ajax) */
    47594748
Note: See TracChangeset for help on using the changeset viewer.