[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
Wed Oct 31 12:08:29 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:  closed
 Priority:  normal         |   Milestone:
Component:  REST API       |     Version:
 Severity:  normal         |  Resolution:  maybelater
 Keywords:                 |     Focuses:
---------------------------+-------------------------
Changes (by danielbachhuber):

 * status:  new => closed
 * resolution:   => maybelater
 * milestone:  Awaiting Review =>


Comment:

 For this particular issue, I think [43737] is the realistic path forward
 at this point. Changing the hook execution order in REST requests seems
 like it would have other unintended consequences.

 You can use `defined( 'REST_REQUEST' ) && REST_REQUEST` in your existing
 classic callbacks to bail early for REST requests, and then [43737] to re-
 hook your behavior into REST requests.

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


More information about the wp-trac mailing list