mirror of
https://github.com/WordPress/WordPress.git
synced 2025-03-09 07:00:01 +00:00
Add rewind_posts().
git-svn-id: http://svn.automattic.com/wordpress/trunk@2026 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
3dae426318
commit
04d470cbbd
@ -579,6 +579,13 @@ class WP_Query {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function rewind_posts() {
|
||||||
|
$this->current_post = -1;
|
||||||
|
if ($this->post_count > 0) {
|
||||||
|
$this->post = $this->posts[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function query($query) {
|
function query($query) {
|
||||||
$this->parse_query($query);
|
$this->parse_query($query);
|
||||||
return $this->get_posts();
|
return $this->get_posts();
|
||||||
|
@ -1232,6 +1232,12 @@ function have_posts() {
|
|||||||
return $wp_query->have_posts();
|
return $wp_query->have_posts();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function rewind_posts() {
|
||||||
|
global $wp_query;
|
||||||
|
|
||||||
|
return $wp_query->rewind_posts();
|
||||||
|
}
|
||||||
|
|
||||||
function the_post() {
|
function the_post() {
|
||||||
start_wp(true);
|
start_wp(true);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user