add_attachment
Fires once an attachment has been added.
Usage
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.
Changelog
Since 2.0.0 | Introduced. |
Where the hook is called
add_attachment
wp-includes/post.php 4983
do_action( 'add_attachment', $post_id );