Ticket #21492: 21492.5.diff
File 21492.5.diff, 1.4 KB (added by , 8 years ago) |
---|
-
src/wp-includes/class-wp-customize-manager.php
366 366 367 367 // Export the settings to JS via the _wpCustomizeSettings variable. 368 368 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 369 373 } 370 374 371 375 /** … … 4219 4223 4220 4224 return $color; 4221 4225 } 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'; 4222 4237 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 4223 4244 /** 4224 4245 * Callback for validating a background setting value. 4225 4246 *