wp_insert_post хук-событиеWP 2.0.0

Fires once a post has been saved.

Использование

add_action( 'wp_insert_post', 'wp_kama_insert_post_action', 10, 3 );

/**
 * Function for `wp_insert_post` 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_insert_post_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.

Список изменений

С версии 2.0.0 Введена.

Где вызывается хук

wp_insert_post()
wp_insert_post
wp_publish_post()
wp_insert_post
WP_Customize_Manager::trash_changeset_post()
wp_insert_post
wp-includes/post.php 4839
do_action( 'wp_insert_post', $post_id, $post, $update );
wp-includes/post.php 5005
do_action( 'wp_insert_post', $post->ID, $post, true );
wp-includes/class-wp-customize-manager.php 3116
do_action( 'wp_insert_post', $post->ID, $post, true );

Где используется хук в WordPress

Использование не найдено.