REST API, Posts: Add a hook to fire once a post, its terms and meta update.
Introduces the action `wp_after_insert_post` inside a wrapper function of the same name. This hook allows plugin developers to access a posts full data (including its terms and meta data) regardless of the workflow used to save it. A new parameter is introduced to `wp_insert_post()` to indicate whether the hook should be fired within the function call or will be fired afterward. Props aristath, Collizo4sky, danielbachhuber, joyously, kadamwhite, kraftbj, markparnell, mikeschroder, noisysocks, peterwilsoncc, SergeyBiryukov, talldanwp, thewebprincess, TimothyBlynJacobs. Fixes #45114. Built from https://develop.svn.wordpress.org/trunk@49172 git-svn-id: http://core.svn.wordpress.org/trunk@48934 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -3105,6 +3105,8 @@ final class WP_Customize_Manager {
|
||||
/** This action is documented in wp-includes/post.php */
|
||||
do_action( 'wp_insert_post', $post->ID, $post, true );
|
||||
|
||||
wp_after_insert_post( $post, true );
|
||||
|
||||
wp_trash_post_comments( $post_id );
|
||||
|
||||
/** This action is documented in wp-includes/post.php */
|
||||
|
||||
Reference in New Issue
Block a user