X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/53f4633144ed68c8b8fb5861f992b5489894a940..febc815b2c9d85be5717da9e8d164bd2daa97e31:/wp-admin/customize.php diff --git a/wp-admin/customize.php b/wp-admin/customize.php index 6ee2de00..bd8e1181 100644 --- a/wp-admin/customize.php +++ b/wp-admin/customize.php @@ -13,24 +13,22 @@ define( 'IFRAME_REQUEST', true ); require_once( dirname( __FILE__ ) . '/admin.php' ); if ( ! current_user_can( 'customize' ) ) { - wp_die( __( 'Cheatin’ uh?' ), 403 ); + wp_die( + '

' . __( 'Cheatin’ uh?' ) . '

' . + '

' . __( 'Sorry, you are not allowed to customize this site.' ) . '

', + 403 + ); } -wp_reset_vars( array( 'url', 'return' ) ); -$url = wp_unslash( $url ); -$url = wp_validate_redirect( $url, home_url( '/' ) ); -if ( $return ) { - $return = wp_unslash( $return ); - $return = wp_validate_redirect( $return ); +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 ( ! $return ) { - if ( $url ) { - $return = $url; - } elseif ( current_user_can( 'edit_theme_options' ) || current_user_can( 'switch_themes' ) ) { - $return = admin_url( 'themes.php' ); - } else { - $return = admin_url(); - } +if ( ! empty( $autofocus ) && is_array( $autofocus ) ) { + $wp_customize->set_autofocus( wp_unslash( $autofocus ) ); } /** @@ -78,9 +76,7 @@ if ( wp_is_mobile() ) : ?>is_ios() ) { $body_class .= ' ios'; } @@ -89,18 +85,12 @@ if ( is_rtl() ) { } $body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) ); -if ( $wp_customize->is_theme_active() ) { - $document_title_tmpl = _x( 'Customize: %s', 'Placeholder is the document title from the preview' ); -} else { - $document_title_tmpl = _x( 'Live Preview: %s', 'Placeholder is the document title from the preview' ); -} -$document_title_tmpl = html_entity_decode( $document_title_tmpl, ENT_QUOTES, 'UTF-8' ); // because exported to JS and assigned to document.title -$admin_title = sprintf( $document_title_tmpl, __( 'Loading…' ) ); +$admin_title = sprintf( $wp_customize->get_document_title_template(), __( 'Loading…' ) ); ?><?php echo $admin_title; ?> - + + + -
+
-
+
' . get_bloginfo( 'name' ) . '' ); ?> - +