From 4a648c38259c782a21987556c71e0071e16d29fe Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Tue, 19 May 2009 16:13:50 +0000 Subject: [PATCH] Pass query object to loop_start and loop_end actions. Props Denis-de-Bernardy. fixes #9854 git-svn-id: https://develop.svn.wordpress.org/trunk@11399 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/query.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-includes/query.php b/wp-includes/query.php index 07174ab275..32a7b8cebd 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -2371,7 +2371,7 @@ class WP_Query { * @since 1.5.0 * @access public * @uses $post - * @uses do_action() Calls 'loop_start' if loop has just started + * @uses do_action_ref_array() Calls 'loop_start' if loop has just started */ function the_post() { unset($GLOBALS['post']); // Break the ref @@ -2382,7 +2382,7 @@ class WP_Query { do_action('the_post', $post); if ( $this->current_post == 0 ) // loop has just started - do_action('loop_start'); + do_action_ref_array('loop_start', array(&$this)); } /** @@ -2392,7 +2392,7 @@ class WP_Query { * * @since 1.5.0 * @access public - * @uses do_action() Calls 'loop_start' if loop has just started + * @uses do_action_ref_array() Calls 'loop_end' if loop is ended * * @return bool True if posts are available, false if end of loop. */ @@ -2400,7 +2400,7 @@ class WP_Query { if ($this->current_post + 1 < $this->post_count) { return true; } elseif ($this->current_post + 1 == $this->post_count && $this->post_count > 0) { - do_action('loop_end'); + do_action_ref_array('loop_end', array(&$this)); // Do some cleaning up after the loop $this->rewind_posts(); }