diff --git a/wp-includes/theme.php b/wp-includes/theme.php index e12ac74dfb..662c926d9c 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -582,8 +582,6 @@ function preview_theme() { // Prevent theme mods to current theme being used on theme being previewed add_filter( 'pre_option_theme_mods_' . get_option( 'stylesheet' ), '__return_empty_array' ); - - ob_start( 'preview_theme_ob_filter' ); } add_action('setup_theme', 'preview_theme'); @@ -621,7 +619,7 @@ function _preview_theme_stylesheet_filter() { * @return string */ function preview_theme_ob_filter( $content ) { - return preg_replace_callback( "|()|", 'preview_theme_ob_filter_callback', $content ); + return $content; } /** @@ -636,26 +634,7 @@ function preview_theme_ob_filter( $content ) { * @return string */ function preview_theme_ob_filter_callback( $matches ) { - if ( strpos($matches[4], 'onclick') !== false ) - $matches[4] = preg_replace('#onclick=([\'"]).*?(?. (? 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => 1 ), $matches[3] ); - if ( 0 === strpos($link, 'preview=1') ) - $link = "?$link"; - return $matches[1] . esc_attr( $link ) . $matches[4]; + return $matches[0]; } /**