[wp-trac] [WordPress Trac] #42864: REST API: Fire an action after items are completely inserted/updated

WordPress Trac noreply at wordpress.org
Tue Oct 16 12:54:04 UTC 2018


#42864: REST API: Fire an action after items are completely inserted/updated
--------------------------+--------------------------------
 Reporter:  pento         |       Owner:  timothyblynjacobs
     Type:  defect (bug)  |      Status:  assigned
 Priority:  normal        |   Milestone:  5.0
Component:  REST API      |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:  rest-api
--------------------------+--------------------------------

Comment (by danielbachhuber):

 Patch looks pretty good, thanks @TimothyBlynJacobs.

 As far as naming goes, I think `rest_after_*` is fine.

 For the sake of precision, should the hooks be called ''after''
 `$request->set_param( 'context', 'edit' );` instead of before? This would
 ensure that the `context` value is always consistent.

 > When working on the attachments hook, I saw that the
 `rest_insert_attachment` hook passes the request data as an array for the
 attachment instead of the actual `WP_Post` object. Is it too late to fix
 that? Should it be a separate ticket?

 Probably too late :/ It would be a separate ticket though.

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


More information about the wp-trac mailing list