Ticket #21492: 21492.4.diff
File 21492.4.diff, 1.3 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 public function enqueue_static_front_page_script() { 4227 // error message if static front and page for posts have same id 4228 $error_message = array( 4229 'error' => esc_html__( 'Front page & Posts page must be different.' ), 4230 ); 4231 // script suffix 4232 $suffix = SCRIPT_DEBUG ? '' : '.min'; 4222 4233 4234 wp_register_script( 'customizer-static-front-page', "/wp-admin/js/customizer-static-front-page$suffix.js", array( 'jquery', 'customize-controls' ) ); 4235 4236 wp_localize_script( 'customizer-static-front-page', 'frontPageError', $error_message ); 4237 wp_enqueue_script( 'customizer-static-front-page' ); 4238 } 4239 4223 4240 /** 4224 4241 * Callback for validating a background setting value. 4225 4242 *