[wp-trac] [WordPress Trac] #45114: Publish posts and fire related hooks on `rest_after_insert_{$this->post_type}` for rest requests.

WordPress Trac noreply at wordpress.org
Thu Oct 25 00:53:35 UTC 2018


#45114: Publish posts and fire related hooks on
`rest_after_insert_{$this->post_type}` for rest requests.
---------------------------+------------------------------
 Reporter:  peterwilsoncc  |       Owner:  (none)
     Type:  enhancement    |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  REST API       |     Version:
 Severity:  normal         |  Resolution:
 Keywords:                 |     Focuses:
---------------------------+------------------------------

Comment (by peterwilsoncc):

 In [attachment:"45114-do-not-merge.diff"], I've created a very, very rough
 POC for the post endpoint.

 * Adds a new private function for firing the hooks after saving a post
 * By default, wp_insert_post will fire these hooks
 * The REST API will wait until all data is fired before firing the hooks
 * Only includes the post endpoint, **attachements** and other end points
 need changes
 * Ideally I would like to delay the post status change until after all
 data has been saved via the API but I am not sure of a good approach.
 * This is the ultimate in hacky hacks, in no way should it be merged
 without change.

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


More information about the wp-trac mailing list