- Timestamp:
- 11/30/2017 11:09:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/widgets/class-wp-widget-recent-posts.php
r41890 r42343 24 24 public function __construct() { 25 25 $widget_ops = array( 26 'classname' => 'widget_recent_entries',27 'description' => __( 'Your site’s most recent Posts.' ),26 'classname' => 'widget_recent_entries', 27 'description' => __( 'Your site’s most recent Posts.' ), 28 28 'customize_selective_refresh' => true, 29 29 ); … … 68 68 * @param array $instance Array of settings for the current widget. 69 69 */ 70 $r = new WP_Query( apply_filters( 'widget_posts_args', array( 71 'posts_per_page' => $number, 72 'no_found_rows' => true, 73 'post_status' => 'publish', 74 'ignore_sticky_posts' => true, 75 ), $instance ) ); 70 $r = new WP_Query( 71 apply_filters( 72 'widget_posts_args', array( 73 'posts_per_page' => $number, 74 'no_found_rows' => true, 75 'post_status' => 'publish', 76 'ignore_sticky_posts' => true, 77 ), $instance 78 ) 79 ); 76 80 77 81 if ( ! $r->have_posts() ) { … … 92 96 ?> 93 97 <li> 94 <a href="<?php the_permalink( $recent_post->ID ); ?>"><?php echo $title 98 <a href="<?php the_permalink( $recent_post->ID ); ?>"><?php echo $title; ?></a> 95 99 <?php if ( $show_date ) : ?> 96 100 <span class="post-date"><?php echo get_the_date( '', $recent_post->ID ); ?></span> … … 114 118 */ 115 119 public function update( $new_instance, $old_instance ) { 116 $instance = $old_instance;117 $instance['title'] = sanitize_text_field( $new_instance['title'] );118 $instance['number'] = (int) $new_instance['number'];120 $instance = $old_instance; 121 $instance['title'] = sanitize_text_field( $new_instance['title'] ); 122 $instance['number'] = (int) $new_instance['number']; 119 123 $instance['show_date'] = isset( $new_instance['show_date'] ) ? (bool) $new_instance['show_date'] : false; 120 124 return $instance;
Note: See TracChangeset
for help on using the changeset viewer.