X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/61343b82c4f0da4c68e4c6373daafff4a81efdd1..3194d1bb103c2d8db4f44feeced5e58ee2756658:/wp-admin/customize.php diff --git a/wp-admin/customize.php b/wp-admin/customize.php index a9e05c2f..aa949e54 100644 --- a/wp-admin/customize.php +++ b/wp-admin/customize.php @@ -1,6 +1,6 @@ ' . __( 'Cheatin’ uh?' ) . '' . + '

' . __( 'You are not allowed to customize the appearance of 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; @@ -31,13 +45,21 @@ add_action( 'customize_controls_print_scripts', 'print_head_scripts', 20 add_action( 'customize_controls_print_footer_scripts', '_wp_footer_scripts' ); add_action( 'customize_controls_print_styles', 'print_admin_styles', 20 ); +/** + * Fires when Customizer controls are initialized, before scripts are enqueued. + * + * @since 3.4.0 + */ do_action( 'customize_controls_init' ); wp_enqueue_script( 'customize-controls' ); wp_enqueue_style( 'customize-controls' ); -wp_enqueue_script( 'accordion' ); - +/** + * Enqueue Customizer control scripts. + * + * @since 3.4.0 + */ do_action( 'customize_controls_enqueue_scripts' ); // Let's roll. @@ -46,165 +68,102 @@ do_action( 'customize_controls_enqueue_scripts' ); wp_user_settings(); _wp_admin_html_begin(); -$body_class = 'wp-core-ui js'; +$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') ) ) ); -?><?php echo $admin_title; ?>get_document_title_template(), __( 'Loading…' ) ); + +?><?php echo $admin_title; ?> + + +
-
is_theme_active() ? __( 'Save & Publish' ) : __( 'Save & Activate' ); - submit_button( $save_text, 'primary save', 'save', false ); + $save_text = $wp_customize->is_theme_active() ? __( 'Save & Publish' ) : __( 'Save & Activate' ); + submit_button( $save_text, 'primary save', 'save', false ); ?> - - + + + + + +
- theme()->get_screenshot(); - $cannot_expand = ! ( $screenshot || $wp_customize->theme()->get('Description') ); - ?> - -
-
-
+
+
+
+
' . $wp_customize->theme()->display('Name') . '' ); + echo sprintf( __( 'You are customizing %s' ), '' . get_bloginfo( 'name' ) . '' ); ?> +
- -
- - - - - theme()->get('Description') ): ?> -
theme()->display('Description'); ?>
- -
- +
-
    - sections() as $section ) - $section->maybe_render(); - ?> -
+
+
+
+
1, - 'template' => $wp_customize->get_template(), - 'stylesheet' => $wp_customize->get_stylesheet(), - 'preview_iframe' => true, - 'TB_iframe' => 'true' - ), home_url( '/' ) ); - - $login_url = add_query_arg( array( - 'interim-login' => 1, - 'customize-login' => 1 - ), wp_login_url() ); - - $settings = array( - 'theme' => array( - 'stylesheet' => $wp_customize->get_stylesheet(), - 'active' => $wp_customize->is_theme_active(), - ), - 'url' => array( - 'preview' => esc_url( $url ? $url : home_url( '/' ) ), - 'parent' => esc_url( admin_url() ), - 'activated' => admin_url( 'themes.php?activated=true&previewed' ), - 'ajax' => esc_url( admin_url( 'admin-ajax.php', 'relative' ) ), - 'allowed' => array_map( 'esc_url', $allowed_urls ), - 'isCrossDomain' => $cross_domain, - 'fallback' => $fallback_url, - 'home' => esc_url( home_url( '/' ) ), - 'login' => $login_url, - ), - 'browser' => array( - 'mobile' => wp_is_mobile(), - 'ios' => $is_ios, - ), - 'settings' => array(), - 'controls' => array(), - 'nonce' => array( - 'save' => wp_create_nonce( 'save-customize_' . $wp_customize->get_stylesheet() ), - 'preview' => wp_create_nonce( 'preview-customize_' . $wp_customize->get_stylesheet() ) - ), - ); - - foreach ( $wp_customize->settings() as $id => $setting ) { - $settings['settings'][ $id ] = array( - 'value' => $setting->js_value(), - 'transport' => $setting->transport, - ); - } - - foreach ( $wp_customize->controls() as $id => $control ) { - $control->to_json(); - $settings['controls'][ $id ] = $control->json; - } - ?> -