mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-16 19:46:21 +00:00
More hooks, fixes #1535
git-svn-id: http://svn.automattic.com/wordpress/trunk@2741 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
a8e34ba8e9
commit
12cd19ce22
@ -598,12 +598,16 @@ class WP_Query {
|
|||||||
$this->in_the_loop = true;
|
$this->in_the_loop = true;
|
||||||
$post = $this->next_post();
|
$post = $this->next_post();
|
||||||
setup_postdata($post);
|
setup_postdata($post);
|
||||||
|
|
||||||
|
if ( $this->current_post == 0 ) // loop has just started
|
||||||
|
do_action('loop_start');
|
||||||
}
|
}
|
||||||
|
|
||||||
function have_posts() {
|
function have_posts() {
|
||||||
if ($this->current_post + 1 < $this->post_count) {
|
if ($this->current_post + 1 < $this->post_count) {
|
||||||
return true;
|
return true;
|
||||||
} elseif ($this->current_post + 1 == $this->post_count) {
|
} elseif ($this->current_post + 1 == $this->post_count) {
|
||||||
|
do_action('loop_end');
|
||||||
// Do some cleaning up after the loop
|
// Do some cleaning up after the loop
|
||||||
$this->rewind_posts();
|
$this->rewind_posts();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user