[wp-trac] [WordPress Trac] #45114: Fire publishing related hooks after all data is saved via the REST API.

WordPress Trac noreply at wordpress.org
Tue Dec 1 20:45:59 UTC 2020


#45114: Fire publishing related hooks after all data is saved via the REST API.
-------------------------------------------------+-------------------------
 Reporter:  peterwilsoncc                        |       Owner:
                                                 |  peterwilsoncc
     Type:  defect (bug)                         |      Status:  closed
 Priority:  normal                               |   Milestone:  5.6
Component:  REST API                             |     Version:
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-dev-note has-patch commit dev-   |     Focuses:
  reviewed                                       |
-------------------------------------------------+-------------------------
Changes (by johnbillion):

 * status:  reopened => closed
 * resolution:   => fixed


Comment:

 In [changeset:"49731" 49731]:
 {{{
 #!CommitTicketReference repository="" revision="49731"
 REST API: Pass the previous state of the post as a parameter to the
 `wp_after_insert_post` hook.

 This enables, for example, the previous post status to be used by this
 hook without the need to first capture it on an earlier hook.

 This also fixes the value of the `$fire_after_hooks` parameter in
 `get_default_post_to_edit()` so the `wp_after_insert_post` action
 correctly fires just once on the new post screen.

 Props Collizo4sky, peterwilsoncc, hellofromTonya, TimothyBlynJacobs,
 SergeyBiryukov

 Fixes #45114
 }}}

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


More information about the wp-trac mailing list