- Timestamp:
- 02/25/2020 07:27:22 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/widgets/class-wp-widget-recent-comments.php
r47122 r47371 67 67 * 68 68 * @since 2.8.0 69 * @since 5.4.0 Creates a unique HTML ID for the `<ul>` element 70 * if more than one instance is displayed on the page. 71 * 72 * @staticvar bool $first_instance 69 73 * 70 74 * @param array $args Display arguments including 'before_title', 'after_title', … … 73 77 */ 74 78 public function widget( $args, $instance ) { 79 static $first_instance = true; 80 75 81 if ( ! isset( $args['widget_id'] ) ) { 76 82 $args['widget_id'] = $this->id; … … 117 123 } 118 124 119 $output .= '<ul id="recentcomments">'; 125 $recent_comments_id = ( $first_instance ) ? 'recentcomments' : "recentcomments-{$this->number}"; 126 $first_instance = false; 127 128 $output .= '<ul id="' . esc_attr( $recent_comments_id ) . '">'; 120 129 if ( is_array( $comments ) && $comments ) { 121 130 // Prime cache for associated posts. (Prime post term cache if we need it for permalinks.)
Note: See TracChangeset
for help on using the changeset viewer.