Make WordPress Core

Ticket #21492: 21492.5.diff

File 21492.5.diff, 1.4 KB (added by MatheusGimenez, 8 years ago)

add phpdoc comment

  • src/wp-includes/class-wp-customize-manager.php

     
    366366
    367367                // Export the settings to JS via the _wpCustomizeSettings variable.
    368368                add_action( 'customize_controls_print_footer_scripts', array( $this, 'customize_pane_settings' ), 1000 );
     369
     370                // Validate static front page settings
     371                add_action( 'customize_controls_enqueue_scripts', array( $this, 'enqueue_static_front_page_script' ) );
     372
    369373        }
    370374
    371375        /**
     
    42194223
    42204224                return $color;
    42214225        }
     4226        /**
     4227         * Enqueue Static Front Page customizer JS
     4228         * @since 4.7.3
     4229         */
     4230        public function enqueue_static_front_page_script() {
     4231                // error message if static front and page for posts have same id
     4232                $error_message = array(
     4233                        'error' => esc_html__( 'Front page & Posts page must be different.' ),
     4234                );
     4235                // script suffix
     4236                $suffix = SCRIPT_DEBUG ? '' : '.min';
    42224237
     4238                wp_register_script( 'customizer-static-front-page', "/wp-admin/js/customizer-static-front-page$suffix.js", array( 'jquery', 'customize-controls' ) );
     4239
     4240                wp_localize_script( 'customizer-static-front-page', 'frontPageError', $error_message );
     4241                wp_enqueue_script( 'customizer-static-front-page' );
     4242        }
     4243
    42234244        /**
    42244245         * Callback for validating a background setting value.
    42254246         *