attachment_updated
Fires once an existing attachment has been updated.
Usage
add_action( 'attachment_updated', 'wp_kama_attachment_updated_action', 10, 3 ); /** * Function for `attachment_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_attachment_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 4.4.0 | Introduced. |
Where the hook is called
attachment_updated
wp-includes/post.php 4741
do_action( 'attachment_updated', $post_id, $post_after, $post_before );
Where the hook is used in WordPress
wp-includes/default-filters.php 453
add_action( 'attachment_updated', 'wp_check_for_changed_slugs', 12, 3 );
wp-includes/default-filters.php 457
add_action( 'attachment_updated', 'wp_check_for_changed_dates', 12, 3 );