Permalink
Browse files

Check that comments haven't already been removed

Double-check that comments haven't already been removed by another plugin.
  • Loading branch information...
1 parent 37953be commit 8a00e6bfda5023994419496eccb811eef67643d0 @maxfenton maxfenton committed Jul 13, 2015
Showing with 3 additions and 1 deletion.
  1. +3 −1 functions.php
View
@@ -465,7 +465,9 @@ function boilerplate_widgets_init() {
*/
function boilerplate_remove_recent_comments_style() {
global $wp_widget_factory;
- remove_action( 'wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) );
+ if ( !empty( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'] ) ) {
+ remove_action( 'wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) );
+ }
}
endif;
add_action( 'widgets_init', 'boilerplate_remove_recent_comments_style' );

0 comments on commit 8a00e6b

Please sign in to comment.