diff --git a/src/wp-includes/class-wp-customize-manager.php b/src/wp-includes/class-wp-customize-manager.php index 6da71a1304..10cee68c46 100644 --- a/src/wp-includes/class-wp-customize-manager.php +++ b/src/wp-includes/class-wp-customize-manager.php @@ -2988,6 +2988,9 @@ final class WP_Customize_Manager { $post->post_status = $new_status; wp_transition_post_status( $new_status, $old_status, $post ); + /** This action is documented in wp-includes/post.php */ + do_action( "edit_post_{$post->post_type}", $post->ID, $post ); + /** This action is documented in wp-includes/post.php */ do_action( 'edit_post', $post->ID, $post ); diff --git a/src/wp-includes/comment.php b/src/wp-includes/comment.php index 9862af3d07..0d1bc4843c 100644 --- a/src/wp-includes/comment.php +++ b/src/wp-includes/comment.php @@ -2471,6 +2471,10 @@ function wp_update_comment_count_now( $post_id ) { * @param int $old The old comment count. */ do_action( 'wp_update_comment_count', $post_id, $new, $old ); + + /** This action is documented in wp-includes/post.php */ + do_action( "edit_post_{$post->post_type}", $post_id, $post ); + /** This action is documented in wp-includes/post.php */ do_action( 'edit_post', $post_id, $post ); diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php index d5deabcb42..911c62dba8 100644 --- a/src/wp-includes/post.php +++ b/src/wp-includes/post.php @@ -3796,6 +3796,19 @@ function wp_insert_post( $postarr, $wp_error = false ) { } if ( $update ) { + /** + * Fires once an existing post has been updated. + * + * The dynamic portion of the hook name, `$post->post_type`, refers to + * the post type slug. + * + * @since 5.0.0 + * + * @param int $post_ID Post ID. + * @param WP_Post $post Post object. + */ + do_action( "edit_post_{$post->post_type}", $post_ID, $post ); + /** * Fires once an existing post has been updated. * @@ -3805,6 +3818,7 @@ function wp_insert_post( $postarr, $wp_error = false ) { * @param WP_Post $post Post object. */ do_action( 'edit_post', $post_ID, $post ); + $post_after = get_post( $post_ID ); /** @@ -3950,6 +3964,9 @@ function wp_publish_post( $post ) { $post->post_status = 'publish'; wp_transition_post_status( 'publish', $old_status, $post ); + /** This action is documented in wp-includes/post.php */ + do_action( "edit_post_{$post->post_type}", $post->ID, $post ); + /** This action is documented in wp-includes/post.php */ do_action( 'edit_post', $post->ID, $post );