edit_post
Fires once an existing post has been updated.
Usage
add_action( 'edit_post', 'wp_kama_edit_post_action', 10, 2 );
/**
* Function for `edit_post` action-hook.
*
* @param int $post_id Post ID.
* @param WP_Post $post Post object.
*
* @return void
*/
function wp_kama_edit_post_action( $post_id, $post ){
// action...
}
- $post_id(int)
- Post ID.
- $post(WP_Post)
- Post object.
Changelog
| Since 1.2.0 | Introduced. |
Where the hook is called
edit_post
edit_post
wp-includes/post.php 5149
do_action( 'edit_post', $post_id, $post );
wp-includes/class-wp-customize-manager.php 3113
do_action( 'edit_post', $post->ID, $post );
wp-includes/post.php 5361
do_action( 'edit_post', $post->ID, $post );
wp-includes/comment.php 2902
do_action( 'edit_post', $post_id, $post );