From 95e1c32720f0ea3e5e9a81eca57f17e1070750ad Mon Sep 17 00:00:00 2001 From: nacin Date: Wed, 23 May 2012 17:56:42 +0000 Subject: [PATCH] Customize API shuffling. * Rename WP_Customize to WP_Customize_Manager. * Move customize-controls.php to wp-admin/customize.php. * Make customize.php the formal entry point, rather than admin.php?customize=on. * Rename is_current_theme_active() to is_theme_active(). * Add getters for the theme, settings, controls, and sections properties. * Allow customize.php (no ?theme=) to load the active theme. Not used yet. see #20736. git-svn-id: http://core.svn.wordpress.org/trunk@20852 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../customize.php | 37 ++++++++----- .../includes/class-wp-plugins-list-table.php | 5 ++ ...ize.php => class-wp-customize-manager.php} | 52 +++++++------------ wp-includes/theme.php | 10 ++-- 4 files changed, 52 insertions(+), 52 deletions(-) rename wp-includes/customize-controls.php => wp-admin/customize.php (78%) rename wp-includes/{class-wp-customize.php => class-wp-customize-manager.php} (96%) 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' );