diff --git a/wp-includes/customize-controls.php b/wp-admin/customize.php similarity index 78% rename from wp-includes/customize-controls.php rename to wp-admin/customize.php index 0ca6b0932..dcc3f9600 100644 --- a/wp-includes/customize-controls.php +++ b/wp-admin/customize.php @@ -7,10 +7,19 @@ * @since 3.4.0 */ -if ( ! defined( 'ABSPATH' ) ) - die; +require_once( './admin.php' ); +if ( ! current_user_can( 'edit_theme_options' ) ) + die( 'Cap check failed' ); -global $wp_scripts; +global $wp_scripts, $wp_customize; + +if ( ! $wp_customize->is_preview() ) + die( 'is_preview() failed' ); + +wp_reset_vars( array( 'theme' ) ); + +if ( ! $theme ) + $theme = get_stylesheet(); $registered = $wp_scripts->registered; $wp_scripts = new WP_Scripts; @@ -33,7 +42,7 @@ do_action( 'customize_controls_enqueue_scripts' ); wp_user_settings(); _wp_admin_html_begin(); -$admin_title = sprintf( __( '%1$s — WordPress' ), strip_tags( sprintf( __( 'Customize %s' ), $this->theme->display('Name') ) ) ); +$admin_title = sprintf( __( '%1$s — WordPress' ), strip_tags( sprintf( __( 'Customize %s' ), $wp_customize->theme()->display('Name') ) ) ); ?><?php echo $admin_title; ?>
- theme->display('Name'); ?> + theme()->display('Name'); ?>
- theme->get_screenshot() ) : ?> + theme()->get_screenshot() ) : ?> - theme->get('Description') ): ?> -
theme->display('Description'); ?>
+ theme()->get('Description') ): ?> +
theme()->display('Description'); ?>
@@ -76,7 +85,7 @@ do_action( 'customize_controls_print_scripts' );