diff --git a/wp-includes/default-widgets.php b/wp-includes/default-widgets.php index 5033ae88ca..d307ec3019 100644 --- a/wp-includes/default-widgets.php +++ b/wp-includes/default-widgets.php @@ -559,8 +559,10 @@ class WP_Widget_Recent_Posts extends WP_Widget { ob_start(); extract($args); - $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Posts') : $instance['title'], $instance, $this->id_base); - if ( empty( $instance['number'] ) || ! $number = absint( $instance['number'] ) ) + $title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : __( 'Recent Posts' ); + $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); + $number = ( ! empty( $instance['number'] ) ) ? absint( $instance['number'] ) : 10; + if ( ! $number ) $number = 10; $show_date = isset( $instance['show_date'] ) ? $instance['show_date'] : false; @@ -675,9 +677,11 @@ class WP_Widget_Recent_Comments extends WP_Widget { extract($args, EXTR_SKIP); $output = ''; - $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Recent Comments' ) : $instance['title'], $instance, $this->id_base ); - if ( empty( $instance['number'] ) || ! $number = absint( $instance['number'] ) ) + $title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : __( 'Recent Comments' ); + $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); + $number = ( ! empty( $instance['number'] ) ) ? absint( $instance['number'] ) : 5; + if ( ! $number ) $number = 5; $comments = get_comments( apply_filters( 'widget_comments_args', array( 'number' => $number, 'status' => 'approve', 'post_status' => 'publish' ) ) ); @@ -717,14 +721,14 @@ class WP_Widget_Recent_Comments 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; ?> -

-

+

+

-

-

+

+