Add widget_comments_args and widget_post_args filters. props ramiy, fixes #16159.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20047 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f11938fde4
commit
814d899e88
|
@ -543,7 +543,7 @@ class WP_Widget_Recent_Posts extends WP_Widget {
|
||||||
if ( empty( $instance['number'] ) || ! $number = absint( $instance['number'] ) )
|
if ( empty( $instance['number'] ) || ! $number = absint( $instance['number'] ) )
|
||||||
$number = 10;
|
$number = 10;
|
||||||
|
|
||||||
$r = new WP_Query(array('posts_per_page' => $number, 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true));
|
$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 ) ) );
|
||||||
if ($r->have_posts()) :
|
if ($r->have_posts()) :
|
||||||
?>
|
?>
|
||||||
<?php echo $before_widget; ?>
|
<?php echo $before_widget; ?>
|
||||||
|
@ -649,7 +649,7 @@ class WP_Widget_Recent_Comments extends WP_Widget {
|
||||||
if ( empty( $instance['number'] ) || ! $number = absint( $instance['number'] ) )
|
if ( empty( $instance['number'] ) || ! $number = absint( $instance['number'] ) )
|
||||||
$number = 5;
|
$number = 5;
|
||||||
|
|
||||||
$comments = get_comments( array( 'number' => $number, 'status' => 'approve', 'post_status' => 'publish' ) );
|
$comments = get_comments( apply_filters( 'widget_comments_args', array( 'number' => $number, 'status' => 'approve', 'post_status' => 'publish' ) ) );
|
||||||
$output .= $before_widget;
|
$output .= $before_widget;
|
||||||
if ( $title )
|
if ( $title )
|
||||||
$output .= $before_title . $title . $after_title;
|
$output .= $before_title . $title . $after_title;
|
||||||
|
|
Loading…
Reference in New Issue