Make WordPress Core

Changeset 27561


Ignore:
Timestamp:
03/17/2014 05:00:22 PM (11 years ago)
Author:
ocean90
Message:

In Recent Posts widget set default number to 5.

props afercia.
fixes #27417.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/default-widgets.php

    r27412 r27561  
    562562        $title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : __( 'Recent Posts' );
    563563        $title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
    564         $number = ( ! empty( $instance['number'] ) ) ? absint( $instance['number'] ) : 10;
     564        $number = ( ! empty( $instance['number'] ) ) ? absint( $instance['number'] ) : 5;
    565565        if ( ! $number )
    566             $number = 10;
     566            $number = 5;
    567567        $show_date = isset( $instance['show_date'] ) ? $instance['show_date'] : false;
    568568
     
    677677        }
    678678
    679         extract($args, EXTR_SKIP);
    680         $output = '';
     679        extract($args, EXTR_SKIP);
     680        $output = '';
    681681
    682682        $title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : __( 'Recent Comments' );
     
    684684        $number = ( ! empty( $instance['number'] ) ) ? absint( $instance['number'] ) : 5;
    685685        if ( ! $number )
    686             $number = 5;
     686            $number = 5;
    687687
    688688        $comments = get_comments( apply_filters( 'widget_comments_args', array( 'number' => $number, 'status' => 'approve', 'post_status' => 'publish' ) ) );
     
    700700                $output .=  '<li class="recentcomments">' . /* translators: comments widget: 1: comment author, 2: post link */ sprintf(_x('%1$s on %2$s', 'widgets'), get_comment_author_link(), '<a href="' . esc_url( get_comment_link($comment->comment_ID) ) . '">' . get_the_title($comment->comment_post_ID) . '</a>') . '</li>';
    701701            }
    702         }
     702        }
    703703        $output .= '</ul>';
    704704        $output .= $after_widget;
Note: See TracChangeset for help on using the changeset viewer.