Make WordPress Core

Ticket #42337: 42337.1.diff

File 42337.1.diff, 4.9 KB (added by westonruter, 7 years ago)

https://github.com/xwp/wordpress-develop/pull/294/commits/7e199cdc7f09a237b2722bb5b702c114242dff6c

  • src/wp-admin/js/customize-controls.js

    diff --git src/wp-admin/js/customize-controls.js src/wp-admin/js/customize-controls.js
    index deafe6c2ca..47e546f9d3 100644
     
    70017001                        publishSettingsBtn = $( '#publish-settings' ),
    70027002                        footerActions = $( '#customize-footer-actions' );
    70037003
     7004                // Add publish settings section in JS instead of PHP since the Customizer depends on it to function.
     7005                api.bind( 'ready', function() {
     7006                        api.section.add( new api.OuterSection( 'publish_settings', {
     7007                                title: api.l10n.publishSettings,
     7008                                priority: 0,
     7009                                active: api.settings.theme.active
     7010                        } ) );
     7011                } );
     7012
    70047013                // Set up publish settings section and its controls.
    70057014                api.section( 'publish_settings', function( section ) {
    70067015                        var updateButtonsState, trashControl, updateSectionActive, isSectionActive, statusControl, dateControl, toggleDateControl, publishWhenTime, pollInterval, updateTimeArrivedPoller, cancelScheduleButtonReminder, timeArrivedPollingInterval = 1000;
  • 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 21760bad4f..ba2a543312 100644
    final class WP_Customize_Manager { 
    891891         */
    892892        public function wp_loaded() {
    893893
     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' );
     911
    894912                /**
    895913                 * Fires once WordPress has loaded, allowing scripts and styles to be initialized.
    896914                 *
    final class WP_Customize_Manager { 
    47264744         */
    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
    47604749                $this->add_panel( new WP_Customize_Themes_Panel( $this, 'themes', array(
  • src/wp-includes/script-loader.php

    diff --git src/wp-includes/script-loader.php src/wp-includes/script-loader.php
    index 6c2312c397..c43659379d 100644
    function wp_default_scripts( &$scripts ) { 
    598598                        __( 'You won&#8217;t be able to install new themes from here yet since your install requires SFTP credentials. For now, please <a href="%s">add themes in the admin</a>.' ),
    599599                        esc_url( admin_url( 'theme-install.php' ) )
    600600                ),
     601                'publishSettings' => __( 'Publish Settings' ),
    601602        ) );
    602603        $scripts->add( 'customize-selective-refresh', "/wp-includes/js/customize-selective-refresh$suffix.js", array( 'jquery', 'wp-util', 'customize-preview' ), false, 1 );
    603604