Home/Hooks/add_attachment
ACTION

add_attachment

Fires once an attachment has been added.

wp-includes/post.php
Line 5033
1 Parameter
View Source

Usage

add_action( 'add_attachment', 'your_callback_function', 10, 1 );

Action Callback:

function your_callback_function( $post_id ) {
    // Your code here
    
}

Parameters

$post_id

Parameter 1

⚡ Action Hook

Action hooks allow you to insert custom code at specific points during WordPress execution. Actions do not return any values.