diff --git a/wp-includes/classes.php b/wp-includes/classes.php index b5583f2696..187b417ad1 100644 --- a/wp-includes/classes.php +++ b/wp-includes/classes.php @@ -578,6 +578,13 @@ class WP_Query { return false; } + + function rewind_posts() { + $this->current_post = -1; + if ($this->post_count > 0) { + $this->post = $this->posts[0]; + } + } function query($query) { $this->parse_query($query); diff --git a/wp-includes/functions.php b/wp-includes/functions.php index b31b94c38f..3a808a55ec 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1232,6 +1232,12 @@ function have_posts() { return $wp_query->have_posts(); } +function rewind_posts() { + global $wp_query; + + return $wp_query->rewind_posts(); +} + function the_post() { start_wp(true); }