diff --git a/wp-includes/default-widgets.php b/wp-includes/default-widgets.php index ac91849dac..13ed69bb34 100644 --- a/wp-includes/default-widgets.php +++ b/wp-includes/default-widgets.php @@ -561,6 +561,7 @@ class WP_Widget_Recent_Posts extends WP_Widget { $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Posts') : $instance['title'], $instance, $this->id_base); if ( empty( $instance['number'] ) || ! $number = absint( $instance['number'] ) ) $number = 10; + $show_date = isset( $instance['show_date'] ) ? $instance['show_date'] : false; $r = new WP_Query( apply_filters( 'widget_posts_args', array( 'posts_per_page' => $number, 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true ) ) ); if ($r->have_posts()) : @@ -568,8 +569,13 @@ class WP_Widget_Recent_Posts extends WP_Widget {
@@ -587,6 +593,7 @@ class WP_Widget_Recent_Posts extends WP_Widget { $instance = $old_instance; $instance['title'] = strip_tags($new_instance['title']); $instance['number'] = (int) $new_instance['number']; + $instance['show_date'] = (bool) $new_instance['show_date']; $this->flush_widget_cache(); $alloptions = wp_cache_get( 'alloptions', 'options' ); @@ -601,14 +608,18 @@ class WP_Widget_Recent_Posts extends WP_Widget { } function form( $instance ) { - $title = isset($instance['title']) ? esc_attr($instance['title']) : ''; - $number = isset($instance['number']) ? absint($instance['number']) : 5; + $title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : ''; + $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' ); ?>" /> +