save_post_(post_type) action-hookWP 3.7.0

Fires once a post has been saved.

The dynamic portion of the hook name, $post->post_type, refers to the post type slug.

Possible hook names include:

Usage

add_action( 'save_post_(post_type)', 'wp_kama_save_post_type_action', 10, 3 );

/**
 * Function for `save_post_(post_type)` action-hook.
 * 
 * @param int     $post_ID Post ID.
 * @param WP_Post $post    Post object.
 * @param bool    $update  Whether this is an existing post being updated.
 *
 * @return void
 */
function wp_kama_save_post_type_action( $post_ID, $post, $update ){

	// action...
}
$post_ID(int)
Post ID.
$post(WP_Post)
Post object.
$update(true|false)
Whether this is an existing post being updated.

Changelog

Since 3.7.0 Introduced.

Where the hook is called

wp_insert_post()
save_post_(post_type)
wp_publish_post()
save_post_(post_type)
WP_Customize_Manager::trash_changeset_post()
save_post_(post_type)
wp-includes/post.php 4662
do_action( "save_post_{$post->post_type}", $post_ID, $post, $update );
wp-includes/post.php 4844
do_action( "save_post_{$post->post_type}", $post->ID, $post, true );
wp-includes/class-wp-customize-manager.php 3104
do_action( "save_post_{$post->post_type}", $post->ID, $post, true );

Where the hook is used in WordPress

wp-includes/default-filters.php 678
add_action( 'save_post_wp_template_part', 'wp_set_unique_slug_on_create_template_part' );