attachment_updated хук-событиеWP 4.4.0

Fires once an existing attachment has been updated.

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

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.

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

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

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

wp_insert_post()
attachment_updated
wp-includes/post.php 4586
do_action( 'attachment_updated', $post_ID, $post_after, $post_before );

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

wp-includes/default-filters.php 446
add_action( 'attachment_updated', 'wp_check_for_changed_slugs', 12, 3 );
wp-includes/default-filters.php 450
add_action( 'attachment_updated', 'wp_check_for_changed_dates', 12, 3 );