]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/widgets/class-wp-widget-recent-comments.php
WordPress 4.5
[autoinstalls/wordpress.git] / wp-includes / widgets / class-wp-widget-recent-comments.php
index 0f1a3b53e920e045a38514aab24f957c79574262..71fb4d2f5a69b4e3d683c45fa46919eb0dc072a0 100644 (file)
@@ -23,12 +23,17 @@ class WP_Widget_Recent_Comments extends WP_Widget {
         * @access public
         */
        public function __construct() {
-               $widget_ops = array('classname' => 'widget_recent_comments', 'description' => __( 'Your site’s most recent comments.' ) );
-               parent::__construct('recent-comments', __('Recent Comments'), $widget_ops);
+               $widget_ops = array(
+                       'classname' => 'widget_recent_comments',
+                       'description' => __( 'Your site’s most recent comments.' ),
+                       'customize_selective_refresh' => true,
+               );
+               parent::__construct( 'recent-comments', __( 'Recent Comments' ), $widget_ops );
                $this->alt_option_name = 'widget_recent_comments';
 
-               if ( is_active_widget(false, false, $this->id_base) )
-                       add_action( 'wp_head', array($this, 'recent_comments_style') );
+               if ( is_active_widget( false, false, $this->id_base ) || is_customize_preview() ) {
+                       add_action( 'wp_head', array( $this, 'recent_comments_style' ) );
+               }
        }
 
        /**