[wp-trac] [WordPress Trac] #21580: check_and_publish_future_post() should set global $post

WordPress Trac wp-trac at lists.automattic.com
Tue Aug 14 19:57:37 UTC 2012


#21580: check_and_publish_future_post() should set global $post
--------------------------+-----------------------------
 Reporter:  MattyRob      |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Cron          |    Version:  3.4.1
 Severity:  major         |   Keywords:  has-patch
--------------------------+-----------------------------
 The above function check to see if posts with a 'future' post type are due
 to become visible on a blog and triggers a bunch of hooks like the post
 transition hooks.

 Hooks such as draft_to_publish behave differently from future_to_publish
 because certain variables that are global in the former case are not in
 the latter case.

 Declaring the $post variable as a global in the
 check_and_publish_future_post() function resolves some of these
 differences, if possible perhaps the $post_id global should be declared
 somewhere too but I can't figure out where just yet.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21580>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list