diff --git a/wp-includes/default-filters.php b/wp-includes/default-filters.php index eb0064e456..0861361857 100644 --- a/wp-includes/default-filters.php +++ b/wp-includes/default-filters.php @@ -173,7 +173,7 @@ add_action('sanitize_comment_cookies', 'sanitize_comment_cookies'); add_action('admin_print_scripts', 'wp_print_scripts', 20); add_action('mce_options', '_mce_set_direction'); add_action('init', 'smilies_init', 5); - add_action( 'plugins_loaded', 'wp_maybe_load_widgets', 0 ); +add_action( 'shutdown', 'wp_ob_end_flush_all', 1); ?> \ No newline at end of file diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 71eae710d7..4ee77810a6 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1530,4 +1530,11 @@ function wp_widgets_add_menu() { ksort($submenu['themes.php'], SORT_NUMERIC); } +// For PHP 5.2, make sure all output buffers are flushed +// before our singletons our destroyed. +function wp_ob_end_flush_all() +{ + while ( @ob_end_flush() ); +} + ?> \ No newline at end of file