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

git-svn-id: https://develop.svn.wordpress.org/trunk@16522 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2010-11-21 13:55:11 +00:00
parent 9a53e46ff5
commit f82118f579
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
}