[wp-trac] [WordPress Trac] #42864: REST API: Fire an action after items are completely inserted/updated
WordPress Trac
noreply at wordpress.org
Mon Dec 11 03:27:25 UTC 2017
#42864: REST API: Fire an action after items are completely inserted/updated
--------------------------+-----------------
Reporter: pento | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 5.0
Component: REST API | Version:
Severity: normal | Keywords:
Focuses: rest-api |
--------------------------+-----------------
In `wp_insert_post()` and `wp_insert_comment()`, the corresponding
`wp_insert_post` and `wp_insert_comment` actions are run at the very end,
after all meta and additional fields are inserted or update.
The equivalent REST API `rest_insert_*` actions are fired ''before'' the
meta and additional fields are updated - there isn't an action to hook
into, which is triggered after.
I expect this to become more of an issue with Gutenberg, as the behaviour
of the existing post editor is that the post and related data have been
completely updated by the time `wp_insert_post` fires.
Related: [https://github.com/WordPress/gutenberg/issues/3898
Gutenberg#3898], #38905.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/42864>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list