Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #24330, comment 22


Ignore:
Timestamp:
05/22/2013 09:36:59 PM (12 years ago)
Author:
ryan
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #24330, comment 22

    initial v1  
    1 setup_postdata() sets global $id but not global $post. This mismatch is the reason the new code breaks for loops that don't set global post to math the post passed to setup_postdata().  In get_the_content(), "if ( $post->ID != $GLOBALS['id'] )" is true in this case and wp_parse_post_content() is run on get_post( 0 ), which is the global post rather than the post that has its content sitting in the pages global. It was sheer accident that these loops ever worked, but worked they did so I'll see what can be done for back compat.
     1setup_postdata() sets global $id but not global $post. This mismatch is the reason the new code breaks for loops that don't set global post to match the post passed to setup_postdata().  In get_the_content(), "if ( $post->ID != $GLOBALS['id'] )" is true in this case and wp_parse_post_content() is run on get_post( 0 ), which is the global post rather than the post that has its content sitting in the pages global. It was sheer accident that these loops ever worked, but worked they did so I'll see what can be done for back compat.