add_attachment
Fires once an attachment has been added.
Использование
add_action( 'add_attachment', 'wp_kama_add_attachment_action' ); /** * Function for `add_attachment` action-hook. * * @param int $post_ID Attachment ID. * * @return void */ function wp_kama_add_attachment_action( $post_ID ){ // action... }
- $post_ID(int)
- Attachment ID.
Список изменений
С версии 2.0.0 | Введена. |
Где вызывается хук
add_attachment
wp-includes/post.php 4640
do_action( 'add_attachment', $post_ID );