Rename caller_get_posts WP_Query flag to ignore_sticky_posts, because that is the only thing it does. fixes #14624. props scribu
git-svn-id: http://svn.automattic.com/wordpress/trunk@15589 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
07c704aad2
commit
4d44c562e4
|
@ -542,7 +542,7 @@ class WP_Widget_Recent_Posts extends WP_Widget {
|
||||||
else if ( $number > 15 )
|
else if ( $number > 15 )
|
||||||
$number = 15;
|
$number = 15;
|
||||||
|
|
||||||
$r = new WP_Query(array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'caller_get_posts' => 1));
|
$r = new WP_Query(array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => true));
|
||||||
if ($r->have_posts()) :
|
if ($r->have_posts()) :
|
||||||
?>
|
?>
|
||||||
<?php echo $before_widget; ?>
|
<?php echo $before_widget; ?>
|
||||||
|
|
|
@ -1122,7 +1122,7 @@ function get_posts($args = null) {
|
||||||
} elseif ( ! empty($r['exclude']) )
|
} elseif ( ! empty($r['exclude']) )
|
||||||
$r['post__not_in'] = wp_parse_id_list( $r['exclude'] );
|
$r['post__not_in'] = wp_parse_id_list( $r['exclude'] );
|
||||||
|
|
||||||
$r['caller_get_posts'] = true;
|
$r['ignore_sticky_posts'] = true;
|
||||||
$r['no_found_rows'] = true;
|
$r['no_found_rows'] = true;
|
||||||
|
|
||||||
$get_posts = new WP_Query;
|
$get_posts = new WP_Query;
|
||||||
|
|
|
@ -1540,8 +1540,14 @@ class WP_Query {
|
||||||
$post_status_join = false;
|
$post_status_join = false;
|
||||||
$page = 1;
|
$page = 1;
|
||||||
|
|
||||||
if ( !isset($q['caller_get_posts']) )
|
if ( isset( $q['caller_get_posts'] ) ) {
|
||||||
$q['caller_get_posts'] = false;
|
_deprecated_argument( 'WP_Query', '3.1', __( '"caller_get_posts" is deprecated. Use "ignore_sticky_posts" instead.' ) );
|
||||||
|
if ( !isset( $q['ignore_sticky_posts'] ) )
|
||||||
|
$q['ignore_sticky_posts'] = $q['caller_get_posts'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !isset( $q['ignore_sticky_posts'] ) )
|
||||||
|
$q['ignore_sticky_posts'] = false;
|
||||||
|
|
||||||
if ( !isset($q['suppress_filters']) )
|
if ( !isset($q['suppress_filters']) )
|
||||||
$q['suppress_filters'] = false;
|
$q['suppress_filters'] = false;
|
||||||
|
@ -2377,7 +2383,7 @@ class WP_Query {
|
||||||
|
|
||||||
// Put sticky posts at the top of the posts array
|
// Put sticky posts at the top of the posts array
|
||||||
$sticky_posts = get_option('sticky_posts');
|
$sticky_posts = get_option('sticky_posts');
|
||||||
if ( $this->is_home && $page <= 1 && is_array($sticky_posts) && !empty($sticky_posts) && !$q['caller_get_posts'] ) {
|
if ( $this->is_home && $page <= 1 && is_array($sticky_posts) && !empty($sticky_posts) && !$q['ignore_sticky_posts'] ) {
|
||||||
$num_posts = count($this->posts);
|
$num_posts = count($this->posts);
|
||||||
$sticky_offset = 0;
|
$sticky_offset = 0;
|
||||||
// Loop over posts and relocate stickies to the front.
|
// Loop over posts and relocate stickies to the front.
|
||||||
|
|
Loading…
Reference in New Issue