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

WordPress Trac wp-trac at lists.automattic.com
Sat Aug 18 16:56:28 UTC 2012


#21580: check_and_publish_future_post() should set global $post
--------------------------+----------------------
 Reporter:  MattyRob      |       Owner:
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Cron          |     Version:  3.4.1
 Severity:  major         |  Resolution:  wontfix
 Keywords:                |
--------------------------+----------------------

Comment (by nacin):

 So then instead of doing transition_hook() with global $post, just do
 transition_hook( $post ).

 scribu and I are going to work on kill off that Codex page. Always try to
 avoid them if possible, especially if a function is already passing them
 to you.

 Accessing $post as it gets passed to a function does not query them again.
 Calling get_post() does not even query the DB a second time — it uses what
 is in cache.

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


More information about the wp-trac mailing list