Ticket #23089: 23089.patch
File 23089.patch, 1.7 KB (added by , 12 years ago) |
---|
-
wp-includes/default-widgets.php
558 558 ob_start(); 559 559 extract($args); 560 560 561 $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Posts') : $instance['title'], $instance, $this->id_base); 562 if ( empty( $instance['number'] ) || ! $number = absint( $instance['number'] ) ) 563 $number = 10; 561 $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Recent Posts' ) : $instance['title'], $instance, $this->id_base ); 562 $number = isset( $instance['number'] ) ? absint( $instance['number'] ) : 10; 564 563 $show_date = isset( $instance['show_date'] ) ? $instance['show_date'] : false; 565 564 566 565 $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 ) ) ); … … 674 673 675 674 extract($args, EXTR_SKIP); 676 675 $output = ''; 677 $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Recent Comments' ) : $instance['title'], $instance, $this->id_base ); 676 $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Recent Comments' ) : $instance['title'], $instance, $this->id_base ); 677 $number = isset( $instance['number'] ) ? absint( $instance['number'] ) : 5; 678 678 679 if ( empty( $instance['number'] ) || ! $number = absint( $instance['number'] ) )680 $number = 5;681 682 679 $comments = get_comments( apply_filters( 'widget_comments_args', array( 'number' => $number, 'status' => 'approve', 'post_status' => 'publish' ) ) ); 683 680 $output .= $before_widget; 684 681 if ( $title )