From 6853258d19a2867627fc9b0987fb8b9503ccb4cc Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Fri, 17 Dec 2010 08:32:53 +0000 Subject: [PATCH] If we are previewing don't show the admin bar. See #15856 git-svn-id: https://develop.svn.wordpress.org/trunk@17020 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/theme.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 70039a0704..6c966f8042 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -1147,6 +1147,10 @@ function preview_theme() { if ( !current_user_can( 'switch_themes' ) ) return; + // Admin Thickbox requests + if ( isset( $_GET['preview_iframe'] ) ) + show_admin_bar( false ); + $_GET['template'] = preg_replace('|[^a-z0-9_./-]|i', '', $_GET['template']); if ( validate_file($_GET['template']) ) @@ -1160,7 +1164,7 @@ function preview_theme() { return; add_filter( 'stylesheet', '_preview_theme_stylesheet_filter' ); } - + // Prevent theme mods to current theme being used on theme being previewed add_filter( 'pre_option_mods_' . get_current_theme(), '__return_empty_array' );