Add a simple filter to allow removing the recent comments default widget styles. fixes #15493, see #14876.

git-svn-id: http://svn.automattic.com/wordpress/trunk@16522 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2010-11-21 13:55:11 +00:00
parent d30ef21e80
commit 72a354331b
2 changed files with 6 additions and 3 deletions

View File

@ -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' );

View File

@ -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;
?>
<style type="text/css">.recentcomments a{display:inline !important;padding:0 !important;margin:0 !important;}</style>
<?php
}