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

WordPress Trac noreply at wordpress.org
Sun Nov 29 22:06:43 UTC 2020


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

Comment (by peterwilsoncc):

 I'll check the various locations the hook is called to see if it's
 possible (mainly to determine if a post is new or not).

 If revisions are enabled it's possible to get the previous version with
 `wp_get_post_revisions( $post_id, [ 'numberposts' => 1, 'offset' => 1 ]
 );`. Granted that's not ideal for plugin authors who don't know if the
 site has revisions on or off but I wanted to note it for now.

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


More information about the wp-trac mailing list