Customizer: Redirect back to referrer. If referrer is a front end page, load that page in the customizer preview. Props nacin, koopersmith. fixes #20877

git-svn-id: http://core.svn.wordpress.org/trunk@21028 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan
2012-06-08 18:45:12 +00:00
parent c819e450a1
commit 69ad7a68ff
4 changed files with 28 additions and 8 deletions

View File

@@ -576,11 +576,12 @@ function wp_admin_bar_appearance_menu( $wp_admin_bar ) {
if ( ! current_user_can( 'edit_theme_options' ) )
return;
$current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$wp_admin_bar->add_menu( array(
'parent' => 'appearance',
'id' => 'customize',
'title' => __('Customize'),
'href' => wp_customize_url(),
'href' => add_query_arg( 'url', urlencode( $current_url ), wp_customize_url() ),
'meta' => array(
'class' => 'hide-if-no-customize',
),