mirror of
https://github.com/WordPress/WordPress.git
synced 2025-03-09 07:00:01 +00:00
Fix loop start, loop end workflow. Props Denis-de-Bernardy. fixes #9944
git-svn-id: http://svn.automattic.com/wordpress/trunk@11464 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
0fc93e28fd
commit
fc523a990a
@ -2385,11 +2385,12 @@ class WP_Query {
|
|||||||
function the_post() {
|
function the_post() {
|
||||||
global $post;
|
global $post;
|
||||||
$this->in_the_loop = true;
|
$this->in_the_loop = true;
|
||||||
|
|
||||||
|
if ( $this->current_post == -1 ) // loop has just started
|
||||||
|
do_action_ref_array('loop_start', array(&$this));
|
||||||
|
|
||||||
$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_ref_array('loop_start', array(&$this));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -2661,8 +2662,6 @@ function wp_old_slug_redirect () {
|
|||||||
function setup_postdata($post) {
|
function setup_postdata($post) {
|
||||||
global $id, $authordata, $day, $currentmonth, $page, $pages, $multipage, $more, $numpages;
|
global $id, $authordata, $day, $currentmonth, $page, $pages, $multipage, $more, $numpages;
|
||||||
|
|
||||||
do_action_ref_array('the_post', array(&$post));
|
|
||||||
|
|
||||||
$id = (int) $post->ID;
|
$id = (int) $post->ID;
|
||||||
|
|
||||||
$authordata = get_userdata($post->post_author);
|
$authordata = get_userdata($post->post_author);
|
||||||
@ -2689,6 +2688,9 @@ function setup_postdata($post) {
|
|||||||
$pages[0] = $post->post_content;
|
$pages[0] = $post->post_content;
|
||||||
$multipage = 0;
|
$multipage = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
do_action_ref_array('the_post', array(&$post));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user