X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/256a3b381f63716209b3527d0a14442ae570c283..16e7b37c7914d753890c1a05a9335f3b43751eb8:/wp-admin/customize.php diff --git a/wp-admin/customize.php b/wp-admin/customize.php index b247b19d..44654c00 100644 --- a/wp-admin/customize.php +++ b/wp-admin/customize.php @@ -1,6 +1,6 @@ ' . __( 'Cheatin’ uh?' ) . '' . + '
' . __( 'Sorry, you are not allowed to customize this site.' ) . '
', + 403 + ); +} +/** + * @global WP_Scripts $wp_scripts + * @global WP_Customize_Manager $wp_customize + */ global $wp_scripts, $wp_customize; +if ( $wp_customize->changeset_post_id() ) { + if ( ! current_user_can( get_post_type_object( 'customize_changeset' )->cap->edit_post, $wp_customize->changeset_post_id() ) ) { + wp_die( + '' . __( 'Sorry, you are not allowed to edit this changeset.' ) . '
', + 403 + ); + } + if ( in_array( get_post_status( $wp_customize->changeset_post_id() ), array( 'publish', 'trash' ), true ) ) { + wp_die( + '' . __( 'This changeset has already been published and cannot be further modified.' ) . '
' . + '' . __( 'Customize New Changes' ) . '
', + 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 ) ); +} + $registered = $wp_scripts->registered; $wp_scripts = new WP_Scripts; $wp_scripts->registered = $registered; @@ -41,8 +74,6 @@ do_action( 'customize_controls_init' ); wp_enqueue_script( 'customize-controls' ); wp_enqueue_style( 'customize-controls' ); -wp_enqueue_script( 'accordion' ); - /** * Enqueue Customizer control scripts. * @@ -61,35 +92,36 @@ $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…' ) ); + ?>