WPDev.one
Core Function
View Source on Trac ↗

wp_after_insert_post()

wp_after_insert_post( mixed $post, mixed $update, mixed $post_before )

Fires actions after a post, its terms and meta data has been saved.

Parameters 3 required

Name / Type Description
(int

| WP_Post) $post The post ID or object that has been saved.

Required
$update
bool

Whether this is an existing post being updated.

Required
mixed

(null | WP_Post) $post_before Null for new posts, the WP_Post object prior to the update for updated posts.

Required

Return Value

(void)
No return value description available.

Function Information

Since Version
5.6.0
Source File
wp-includes/post.php
Advertisement