From 26e0d68be0657c028c1fcaba426c4708e14beaec Mon Sep 17 00:00:00 2001 From: nacin Date: Sat, 26 May 2012 15:32:05 +0000 Subject: [PATCH] Theme Customizer: As customize.php without a theme parameter defaults to the current theme, update wp_customize_url() to make $stylesheet optional and update references for the current theme. see #19910, #20751, #20575. git-svn-id: http://core.svn.wordpress.org/trunk@20934 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/themes.php | 4 ++-- wp-includes/admin-bar.php | 2 +- wp-includes/theme.php | 9 +++++++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/wp-admin/themes.php b/wp-admin/themes.php index 80d9b1983..1a49f62bd 100644 --- a/wp-admin/themes.php +++ b/wp-admin/themes.php @@ -120,7 +120,7 @@ $customize_title = sprintf( __( 'Customize “%s”' ), $ct->display('Na ?>
- + <?php esc_attr_e( 'Current theme preview' ); ?> <?php esc_attr_e( 'Current theme preview' ); ?> @@ -141,7 +141,7 @@ $customize_title = sprintf( __( 'Customize “%s”' ), $ct->display('Na
- + 'appearance', 'id' => 'customize', 'title' => __('Customize'), - 'href' => wp_customize_url(get_stylesheet()), + 'href' => wp_customize_url(), 'meta' => array( 'class' => 'hide-if-no-customize', ), diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 5485b3ed5..004a5281d 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -1615,9 +1615,14 @@ add_action( 'admin_enqueue_scripts', '_wp_customize_loader_settings' ); * Returns a URL to load the theme customizer. * * @since 3.4.0 + * + * @param string $stylesheet Optional. Theme to customize. Defaults to current theme. */ -function wp_customize_url( $stylesheet ) { - return esc_url( admin_url( 'customize.php' ) . '?theme=' . $stylesheet ); +function wp_customize_url( $stylesheet = null ) { + $url = admin_url( 'customize.php' ); + if ( $stylesheet ) + $url .= '?theme=' . $stylesheet; + return esc_url( $url ); } /**