diff --git a/wp-content/themes/twentyten/functions.php b/wp-content/themes/twentyten/functions.php index 4b16a0939..3b2184380 100644 --- a/wp-content/themes/twentyten/functions.php +++ b/wp-content/themes/twentyten/functions.php @@ -430,8 +430,7 @@ add_action( 'widgets_init', 'twentyten_widgets_init' ); * @since Twenty Ten 1.0 */ function twentyten_remove_recent_comments_style() { - global $wp_widget_factory; - remove_action( 'wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) ); + add_filter( 'show_recent_comments_widget_style', '__return_false' ); } add_action( 'widgets_init', 'twentyten_remove_recent_comments_style' ); diff --git a/wp-includes/default-widgets.php b/wp-includes/default-widgets.php index ca074c949..b4847d0e6 100644 --- a/wp-includes/default-widgets.php +++ b/wp-includes/default-widgets.php @@ -614,7 +614,11 @@ class WP_Widget_Recent_Comments extends WP_Widget { add_action( 'transition_comment_status', array(&$this, 'flush_widget_cache') ); } - function recent_comments_style() { ?> + function recent_comments_style() { + if ( ! current_theme_supports( 'widgets' ) // Temp hack #14876 + || ! apply_filters( 'show_recent_comments_widget_style', true, $this->id_base ) ) + return; + ?>