Make WordPress Core


Ignore:
Timestamp:
02/29/2012 09:56:24 PM (13 years ago)
Author:
nacin
Message:

Add widget_comments_args and widget_post_args filters. props ramiy, fixes #16159.

File:
1 edited

Legend:

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

    r19838 r20047  
    544544            $number = 10;
    545545
    546         $r = new WP_Query(array('posts_per_page' => $number, 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true));
     546        $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 ) ) );
    547547        if ($r->have_posts()) :
    548548?>
     
    650650            $number = 5;
    651651
    652         $comments = get_comments( array( 'number' => $number, 'status' => 'approve', 'post_status' => 'publish' ) );
     652        $comments = get_comments( apply_filters( 'widget_comments_args', array( 'number' => $number, 'status' => 'approve', 'post_status' => 'publish' ) ) );
    653653        $output .= $before_widget;
    654654        if ( $title )
Note: See TracChangeset for help on using the changeset viewer.