diff --git a/src/wp-includes/widgets/class-wp-widget-recent-comments.php b/src/wp-includes/widgets/class-wp-widget-recent-comments.php
index 6d89eeea24..d43120c95a 100644
a
|
b
|
class WP_Widget_Recent_Comments extends WP_Widget { |
66 | 66 | * Outputs the content for the current Recent Comments widget instance. |
67 | 67 | * |
68 | 68 | * @since 2.8.0 |
| 69 | * @since 5.3.0 Added $first_recentcomments staticvar |
| 70 | * |
| 71 | * @staticvar bool $first_dropdown |
69 | 72 | * |
70 | 73 | * @param array $args Display arguments including 'before_title', 'after_title', |
71 | 74 | * 'before_widget', and 'after_widget'. |
72 | 75 | * @param array $instance Settings for the current Recent Comments widget instance. |
73 | 76 | */ |
74 | 77 | public function widget( $args, $instance ) { |
| 78 | static $first_recentcomments = true; |
| 79 | |
75 | 80 | if ( ! isset( $args['widget_id'] ) ) { |
76 | 81 | $args['widget_id'] = $this->id; |
77 | 82 | } |
… |
… |
class WP_Widget_Recent_Comments extends WP_Widget { |
111 | 116 | ) |
112 | 117 | ); |
113 | 118 | |
114 | | $output .= $args['before_widget']; |
| 119 | $recentcomments_id = ( $first_recentcomments ) ? 'recentcomments' : esc_attr( $args['widget_id'] ); |
| 120 | $first_recentcomments = false; |
| 121 | |
| 122 | $output .= '<ul id="' . $recentcomments_id . '">'; |
115 | 123 | if ( $title ) { |
116 | 124 | $output .= $args['before_title'] . $title . $args['after_title']; |
117 | 125 | } |