From 4d44c562e4076af444d46922edc3ca2fa2520ba2 Mon Sep 17 00:00:00 2001 From: markjaquith Date: Tue, 7 Sep 2010 04:46:08 +0000 Subject: [PATCH] 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 --- wp-includes/default-widgets.php | 2 +- wp-includes/post.php | 2 +- wp-includes/query.php | 12 +++++++++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/wp-includes/default-widgets.php b/wp-includes/default-widgets.php index 2c9ec06724..6a63fa1f05 100644 --- a/wp-includes/default-widgets.php +++ b/wp-includes/default-widgets.php @@ -542,7 +542,7 @@ class WP_Widget_Recent_Posts extends WP_Widget { else if ( $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()) : ?> diff --git a/wp-includes/post.php b/wp-includes/post.php index b5923ea398..61496abe31 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -1122,7 +1122,7 @@ function get_posts($args = null) { } elseif ( ! empty($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; $get_posts = new WP_Query; diff --git a/wp-includes/query.php b/wp-includes/query.php index 94b18cd339..3354f555ce 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -1540,8 +1540,14 @@ class WP_Query { $post_status_join = false; $page = 1; - if ( !isset($q['caller_get_posts']) ) - $q['caller_get_posts'] = false; + if ( isset( $q['caller_get_posts'] ) ) { + _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']) ) $q['suppress_filters'] = false; @@ -2377,7 +2383,7 @@ class WP_Query { // Put sticky posts at the top of the posts array $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); $sticky_offset = 0; // Loop over posts and relocate stickies to the front.