wp/wp-admin/customize.php
changeset 22 8c2e4d02f4ef
parent 21 48c4eec2b7e6
equal deleted inserted replaced
21:48c4eec2b7e6 22:8c2e4d02f4ef
    74 		);
    74 		);
    75 	}
    75 	}
    76 
    76 
    77 	if ( in_array( get_post_status( $changeset_post->ID ), array( 'publish', 'trash' ), true ) ) {
    77 	if ( in_array( get_post_status( $changeset_post->ID ), array( 'publish', 'trash' ), true ) ) {
    78 		wp_die(
    78 		wp_die(
    79 			'<h1>' . __( 'Something went wrong.' ) . '</h1>' .
    79 			'<h1>' . __( 'An error occurred while saving your changeset.' ) . '</h1>' .
    80 			'<p>' . __( 'This changeset cannot be further modified.' ) . '</p>' .
    80 			'<p>' . __( 'Please try again or start a new changeset. This changeset cannot be further modified.' ) . '</p>' .
    81 			'<p><a href="' . esc_url( remove_query_arg( 'changeset_uuid' ) ) . '">' . __( 'Customize New Changes' ) . '</a></p>',
    81 			'<p><a href="' . esc_url( remove_query_arg( 'changeset_uuid' ) ) . '">' . __( 'Customize New Changes' ) . '</a></p>',
    82 			403
    82 			403
    83 		);
    83 		);
    84 	}
    84 	}
    85 }
    85 }
    86 
    86 
    87 $url       = ! empty( $_REQUEST['url'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['url'] ) ) : '';
    87 $url       = ! empty( $_REQUEST['url'] ) ? esc_url_raw( wp_unslash( $_REQUEST['url'] ) ) : '';
    88 $return    = ! empty( $_REQUEST['return'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['return'] ) ) : '';
    88 $return    = ! empty( $_REQUEST['return'] ) ? esc_url_raw( wp_unslash( $_REQUEST['return'] ) ) : '';
    89 $autofocus = ! empty( $_REQUEST['autofocus'] ) && is_array( $_REQUEST['autofocus'] )
    89 $autofocus = ! empty( $_REQUEST['autofocus'] ) && is_array( $_REQUEST['autofocus'] )
    90 	? array_map( 'sanitize_text_field', wp_unslash( $_REQUEST['autofocus'] ) )
    90 	? array_map( 'sanitize_text_field', wp_unslash( $_REQUEST['autofocus'] ) )
    91 	: array();
    91 	: array();
    92 
    92 
    93 if ( ! empty( $url ) ) {
    93 if ( ! empty( $url ) ) {
    98 }
    98 }
    99 if ( ! empty( $autofocus ) ) {
    99 if ( ! empty( $autofocus ) ) {
   100 	$wp_customize->set_autofocus( $autofocus );
   100 	$wp_customize->set_autofocus( $autofocus );
   101 }
   101 }
   102 
   102 
       
   103 // Let's roll.
       
   104 header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );
       
   105 
       
   106 wp_user_settings();
       
   107 _wp_admin_html_begin();
       
   108 
   103 $registered             = $wp_scripts->registered;
   109 $registered             = $wp_scripts->registered;
   104 $wp_scripts             = new WP_Scripts();
   110 $wp_scripts             = new WP_Scripts();
   105 $wp_scripts->registered = $registered;
   111 $wp_scripts->registered = $registered;
   106 
   112 
   107 add_action( 'customize_controls_print_scripts', 'print_head_scripts', 20 );
   113 add_action( 'customize_controls_print_scripts', 'print_head_scripts', 20 );
   123  * Fires when enqueuing Customizer control scripts.
   129  * Fires when enqueuing Customizer control scripts.
   124  *
   130  *
   125  * @since 3.4.0
   131  * @since 3.4.0
   126  */
   132  */
   127 do_action( 'customize_controls_enqueue_scripts' );
   133 do_action( 'customize_controls_enqueue_scripts' );
   128 
       
   129 // Let's roll.
       
   130 header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );
       
   131 
       
   132 wp_user_settings();
       
   133 _wp_admin_html_begin();
       
   134 
   134 
   135 $body_class = 'wp-core-ui wp-customizer js';
   135 $body_class = 'wp-core-ui wp-customizer js';
   136 
   136 
   137 if ( wp_is_mobile() ) :
   137 if ( wp_is_mobile() ) :
   138 	$body_class .= ' mobile';
   138 	$body_class .= ' mobile';
   231 				<ul></ul>
   231 				<ul></ul>
   232 			</div>
   232 			</div>
   233 			<div class="wp-full-overlay-sidebar-content" tabindex="-1">
   233 			<div class="wp-full-overlay-sidebar-content" tabindex="-1">
   234 				<div id="customize-info" class="accordion-section customize-info" data-block-theme="<?php echo (int) wp_is_block_theme(); ?>">
   234 				<div id="customize-info" class="accordion-section customize-info" data-block-theme="<?php echo (int) wp_is_block_theme(); ?>">
   235 					<div class="accordion-section-title">
   235 					<div class="accordion-section-title">
   236 						<span class="preview-notice">
   236 						<h2 class="preview-notice">
   237 						<?php
   237 						<?php
   238 							/* translators: %s: The site/panel title in the Customizer. */
   238 							/* translators: %s: The site/panel title in the Customizer. */
   239 							printf( __( 'You are customizing %s' ), '<strong class="panel-title site-title">' . get_bloginfo( 'name', 'display' ) . '</strong>' );
   239 							printf( __( 'You are customizing %s' ), '<strong class="panel-title site-title">' . get_bloginfo( 'name', 'display' ) . '</strong>' );
   240 						?>
   240 						?>
   241 						</span>
   241 						</h2>
   242 						<button type="button" class="customize-help-toggle dashicons dashicons-editor-help" aria-expanded="false"><span class="screen-reader-text">
   242 						<button type="button" class="customize-help-toggle dashicons dashicons-editor-help" aria-expanded="false"><span class="screen-reader-text">
   243 							<?php
   243 							<?php
   244 							/* translators: Hidden accessibility text. */
   244 							/* translators: Hidden accessibility text. */
   245 							_e( 'Help' );
   245 							_e( 'Help' );
   246 							?>
   246 							?>