diff --git src/wp-includes/widgets/class-wp-widget-recent-posts.php src/wp-includes/widgets/class-wp-widget-recent-posts.php
index c8d19055b4..19ad5371af 100644
|
|
class WP_Widget_Recent_Posts extends WP_Widget { |
80 | 80 | echo $args['before_title'] . $title . $args['after_title']; |
81 | 81 | } ?> |
82 | 82 | <ul> |
83 | | <?php while ( $r->have_posts() ) : $r->the_post(); ?> |
| 83 | <?php |
| 84 | foreach ( $r->posts as $recent_post ) : |
| 85 | $post_title = get_the_title( $recent_post->ID ); |
| 86 | $title = ( ! empty( $post_title ) ) ? $post_title : __( '(no title)' ); |
| 87 | ?> |
84 | 88 | <li> |
85 | | <a href="<?php the_permalink(); ?>"><?php get_the_title() ? the_title() : _e( '(no title)' ); ?></a> |
86 | | <?php if ( $show_date ) : ?> |
87 | | <span class="post-date"><?php echo get_the_date(); ?></span> |
88 | | <?php endif; ?> |
| 89 | <a href="<?php get_the_permalink( $recent_post->ID ); ?>"><?php echo $title ; ?></a> |
| 90 | <?php if ( $show_date ) : ?> |
| 91 | <span class="post-date"><?php echo get_the_date( '', $recent_post->ID ); ?></span> |
| 92 | <?php endif; ?> |
89 | 93 | </li> |
90 | | <?php endwhile; ?> |
| 94 | <?php endforeach;?> |
91 | 95 | </ul> |
92 | | <?php echo $args['after_widget']; ?> |
93 | | <?php |
94 | | // Reset the global $the_post as this query will have stomped on it |
95 | | wp_reset_postdata(); |
96 | | |
| 96 | <?php echo $args['after_widget']; |
97 | 97 | endif; |
98 | 98 | } |
99 | 99 | |