[wp-trac] [WordPress Trac] #36603: wp_publish_post() does not fire post_updated action

WordPress Trac noreply at wordpress.org
Fri May 27 01:01:18 UTC 2016


#36603: wp_publish_post() does not fire post_updated action
-------------------------------+--------------------
 Reporter:  Rarst              |       Owner:
     Type:  enhancement        |      Status:  new
 Priority:  normal             |   Milestone:  4.6
Component:  Posts, Post Types  |     Version:  trunk
 Severity:  normal             |  Resolution:
 Keywords:  has-patch          |     Focuses:
-------------------------------+--------------------

Comment (by peterwilsoncc):

 Within core `wp_publish_post()` is only called from
 `check_and_publish_future_post()`, it lacks two features of
 `wp_update_post()` and `wp_insert_post()`:

 * `post_updated` does not fire
 * `wp_post->date_modified` does not change
 * `wp_post->date_modified_gmt` does not change

 My educated guess is it's by design and publishing a scheduled post is not
 considered an update per se.

 A number of suitable actions are fired in `wp_transition_post_status()`,
 my inclination is to leave `wp_publish_post()` unchanged.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36603#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list