post_updated action-hookWP 3.0.0

Fires once an existing post has been updated.

Usage

add_action( 'post_updated', 'wp_kama_post_updated_action', 10, 3 );

/**
 * Function for `post_updated` action-hook.
 * 
 * @param int     $post_id     Post ID.
 * @param WP_Post $post_after  Post object following the update.
 * @param WP_Post $post_before Post object before the update.
 *
 * @return void
 */
function wp_kama_post_updated_action( $post_id, $post_after, $post_before ){

	// action...
}
$post_id(int)
Post ID.
$post_after(WP_Post)
Post object following the update.
$post_before(WP_Post)
Post object before the update.

Changelog

Since 3.0.0 Introduced.

Where the hook is called

wp_insert_post()
post_updated
wp-includes/post.php 4797
do_action( 'post_updated', $post_id, $post_after, $post_before );

Where the hook is used in WordPress

wp-admin/includes/admin-filters.php 168
add_action( 'post_updated', array( 'WP_Privacy_Policy_Content', '_policy_page_updated' ) );
wp-includes/default-filters.php 415
add_action( 'post_updated', 'wp_save_post_revision', 10, 1 );
wp-includes/default-filters.php 452
add_action( 'post_updated', 'wp_check_for_changed_slugs', 12, 3 );
wp-includes/default-filters.php 456
add_action( 'post_updated', 'wp_check_for_changed_dates', 12, 3 );