wp_after_insert_post WordPress Action Hook

The wp_after_insert_post hook is called after a new post has been inserted into the database. It can be used to perform any actions that need to be done after a new post has been created.

do_action( 'wp_after_insert_post', int $post_id, WP_Post $post, bool $update, null|WP_Post $post_before ) #

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


Parameters

$post_id

(int)Post ID.

$post

(WP_Post)Post object.

$update

(bool)Whether this is an existing post being updated.

$post_before

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


Top ↑

Source

File: wp-includes/post.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
5.6.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More