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

WordPress Trac noreply at wordpress.org
Fri May 27 16:16:57 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 DrewAPicture):

 Replying to [comment:4 Rarst]:
 > > My educated guess is it's by design and publishing a scheduled post is
 not considered an update per se.
 >
 > It changes one of the most important post fields in a major way. If it's
 by design I would like to hear a reason why it shouldn't be handled
 consistently with every other post change.
 >

 I can get on board with the idea that publishing a scheduled post
 constitutes a post update.

 On whether we should add the hook, I actually wonder if maybe we shouldn't
 look at deprecating `wp_publish_post()` and switch to using
 `wp_insert_post()` in `check_and_publish_future_post()` instead. You can
 attempt to maintain a parallel use-case for only so long before it becomes
 pointless.

 Of course we pick up a hook or two in the process, but it also would
 streamline the API a bit. It would need a good bit of tests to make sure
 we aren't breaking something.

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


More information about the wp-trac mailing list