wp_after_insert_post хук-событие . WP 5.6.0
Fires once a post, its terms and meta data has been saved.
Использование
add_action( 'wp_after_insert_post', 'action_function_name_9843', 10, 4 ); function action_function_name_9843( $post_id, $post, $update, $post_before ){ // action... }
- $post_id(число)
- Post ID.
- $post(WP_Post)
- Post object.
- $update(true/false)
- 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.
Список изменений
С версии 5.6.0 | Введена. |
Где вызывается хук
wp_after_insert_post
wp-includes/post.php 4967
do_action( 'wp_after_insert_post', $post_id, $post, $update, $post_before );