X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/41578db67d72562346e4dbb2a14889b23d522813..607b7e02d77e7326161e8ec15639052d2040f745:/wp-admin/customize.php?ds=sidebyside diff --git a/wp-admin/customize.php b/wp-admin/customize.php index b1485d1f..bd8e1181 100644 --- a/wp-admin/customize.php +++ b/wp-admin/customize.php @@ -12,17 +12,29 @@ define( 'IFRAME_REQUEST', true ); /** Load WordPress Administration Bootstrap */ require_once( dirname( __FILE__ ) . '/admin.php' ); -if ( ! current_user_can( 'edit_theme_options' ) ) - wp_die( __( 'Cheatin’ uh?' ) ); - -wp_reset_vars( array( 'url', 'return' ) ); -$url = urldecode( $url ); -$url = wp_validate_redirect( $url, home_url( '/' ) ); -if ( $return ) - $return = wp_validate_redirect( urldecode( $return ) ); -if ( ! $return ) - $return = $url; +if ( ! current_user_can( 'customize' ) ) { + wp_die( + '
' . __( 'Sorry, you are not allowed to customize this site.' ) . '
', + 403 + ); +} + +wp_reset_vars( array( 'url', 'return', 'autofocus' ) ); +if ( ! empty( $url ) ) { + $wp_customize->set_preview_url( wp_unslash( $url ) ); +} +if ( ! empty( $return ) ) { + $wp_customize->set_return_url( wp_unslash( $return ) ); +} +if ( ! empty( $autofocus ) && is_array( $autofocus ) ) { + $wp_customize->set_autofocus( wp_unslash( $autofocus ) ); +} +/** + * @global WP_Scripts $wp_scripts + * @global WP_Customize_Manager $wp_customize + */ global $wp_scripts, $wp_customize; $registered = $wp_scripts->registered; @@ -43,8 +55,6 @@ do_action( 'customize_controls_init' ); wp_enqueue_script( 'customize-controls' ); wp_enqueue_style( 'customize-controls' ); -wp_enqueue_script( 'accordion' ); - /** * Enqueue Customizer control scripts. * @@ -63,23 +73,24 @@ $body_class = 'wp-core-ui wp-customizer js'; if ( wp_is_mobile() ) : $body_class .= ' mobile'; - ?>is_ios() ) { $body_class .= ' ios'; +} -if ( is_rtl() ) - $body_class .= ' rtl'; +if ( is_rtl() ) { + $body_class .= ' rtl'; +} $body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) ); -$admin_title = sprintf( __( '%1$s — WordPress' ), strip_tags( sprintf( __( 'Customize %s' ), $wp_customize->theme()->display('Name') ) ) ); +$admin_title = sprintf( $wp_customize->get_document_title_template(), __( 'Loading…' ) ); + ?>