wp/wp-admin/customize.php
changeset 21 48c4eec2b7e6
parent 19 3d72ae0968f4
child 22 8c2e4d02f4ef
--- a/wp/wp-admin/customize.php	Thu Sep 29 08:06:27 2022 +0200
+++ b/wp/wp-admin/customize.php	Fri Sep 05 18:40:08 2025 +0200
@@ -84,20 +84,24 @@
 	}
 }
 
+$url       = ! empty( $_REQUEST['url'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['url'] ) ) : '';
+$return    = ! empty( $_REQUEST['return'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['return'] ) ) : '';
+$autofocus = ! empty( $_REQUEST['autofocus'] ) && is_array( $_REQUEST['autofocus'] )
+	? array_map( 'sanitize_text_field', wp_unslash( $_REQUEST['autofocus'] ) )
+	: array();
 
-wp_reset_vars( array( 'url', 'return', 'autofocus' ) );
 if ( ! empty( $url ) ) {
-	$wp_customize->set_preview_url( wp_unslash( $url ) );
+	$wp_customize->set_preview_url( $url );
 }
 if ( ! empty( $return ) ) {
-	$wp_customize->set_return_url( wp_unslash( $return ) );
+	$wp_customize->set_return_url( $return );
 }
-if ( ! empty( $autofocus ) && is_array( $autofocus ) ) {
-	$wp_customize->set_autofocus( wp_unslash( $autofocus ) );
+if ( ! empty( $autofocus ) ) {
+	$wp_customize->set_autofocus( $autofocus );
 }
 
 $registered             = $wp_scripts->registered;
-$wp_scripts             = new WP_Scripts;
+$wp_scripts             = new WP_Scripts();
 $wp_scripts->registered = $registered;
 
 add_action( 'customize_controls_print_scripts', 'print_head_scripts', 20 );
@@ -116,7 +120,7 @@
 wp_enqueue_style( 'customize-controls' );
 
 /**
- * Enqueue Customizer control scripts.
+ * Fires when enqueuing Customizer control scripts.
  *
  * @since 3.4.0
  */
@@ -207,7 +211,12 @@
 				<span class="preview"><?php _e( 'Preview' ); ?></span>
 			</button>
 			<a class="customize-controls-close" href="<?php echo esc_url( $wp_customize->get_return_url() ); ?>">
-				<span class="screen-reader-text"><?php _e( 'Close the Customizer and go back to the previous page' ); ?></span>
+				<span class="screen-reader-text">
+					<?php
+					/* translators: Hidden accessibility text. */
+					_e( 'Close the Customizer and go back to the previous page' );
+					?>
+				</span>
 			</a>
 		</div>
 
@@ -230,7 +239,12 @@
 							printf( __( 'You are customizing %s' ), '<strong class="panel-title site-title">' . get_bloginfo( 'name', 'display' ) . '</strong>' );
 						?>
 						</span>
-						<button type="button" class="customize-help-toggle dashicons dashicons-editor-help" aria-expanded="false"><span class="screen-reader-text"><?php _e( 'Help' ); ?></span></button>
+						<button type="button" class="customize-help-toggle dashicons dashicons-editor-help" aria-expanded="false"><span class="screen-reader-text">
+							<?php
+							/* translators: Hidden accessibility text. */
+							_e( 'Help' );
+							?>
+						</span></button>
 					</div>
 					<div class="customize-panel-description">
 						<p>
@@ -240,7 +254,7 @@
 						</p>
 						<p>
 							<?php
-							_e( '<a href="https://wordpress.org/support/article/appearance-customize-screen/">Documentation on Customizer</a>' );
+							_e( '<a href="https://wordpress.org/documentation/article/customizer/">Documentation on Customizer</a>' );
 							?>
 						</p>
 					</div>