[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
Sat Nov 3 23:32:31 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:
---------------------------+-------------------------

Comment (by danielbachhuber):

 @peterwilsoncc I'm slightly terrified of making any chances to
 `wp_insert_post()` at the risk of the sky falling on our heads. Is it
 possible to solve for this problem within the REST API controllers
 instead?

 > As `REST_REQUEST` is only defined within HTTP requests to the rest API
 but not internal requests, it's an unsuitable check for the purpose of
 moving these hooks.

 What are some real-world contexts where internal, not HTTP, requests would
 be used for write operations?

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


More information about the wp-trac mailing list