diff -r 3d4e9c994f10 -r a86126ab1dd4 wp/wp-includes/widgets/class-wp-widget-recent-posts.php --- a/wp/wp-includes/widgets/class-wp-widget-recent-posts.php Tue Oct 22 16:11:46 2019 +0200 +++ b/wp/wp-includes/widgets/class-wp-widget-recent-posts.php Tue Dec 15 13:49:49 2020 +0100 @@ -45,7 +45,8 @@ $args['widget_id'] = $this->id; } - $title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : __( 'Recent Posts' ); + $default_title = __( 'Recent Posts' ); + $title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : $default_title; /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */ $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); @@ -56,18 +57,18 @@ } $show_date = isset( $instance['show_date'] ) ? $instance['show_date'] : false; - /** - * Filters the arguments for the Recent Posts widget. - * - * @since 3.4.0 - * @since 4.9.0 Added the `$instance` parameter. - * - * @see WP_Query::get_posts() - * - * @param array $args An array of arguments used to retrieve the recent posts. - * @param array $instance Array of settings for the current widget. - */ $r = new WP_Query( + /** + * Filters the arguments for the Recent Posts widget. + * + * @since 3.4.0 + * @since 4.9.0 Added the `$instance` parameter. + * + * @see WP_Query::get_posts() + * + * @param array $args An array of arguments used to retrieve the recent posts. + * @param array $instance Array of settings for the current widget. + */ apply_filters( 'widget_posts_args', array( @@ -84,27 +85,52 @@ return; } ?> + + '; + } ?> + + '; + } + echo $args['after_widget']; } @@ -138,14 +164,20 @@ $number = isset( $instance['number'] ) ? absint( $instance['number'] ) : 5; $show_date = isset( $instance['show_date'] ) ? (bool) $instance['show_date'] : false; ?> -

-

+

+ + +

-

-

+

+ + +

-

id="get_field_id( 'show_date' ); ?>" name="get_field_name( 'show_date' ); ?>" /> -

+

+ id="get_field_id( 'show_date' ); ?>" name="get_field_name( 'show_date' ); ?>" /> + +