On this page
do_action( 'wp_media_attach_action', string $action, int $attachment_id, int $parent_id )
Fires when media is attached or detached from a post.
Parameters
$actionstring-
Attach/detach action. Accepts
'attach'or'detach'. $attachment_idint-
The attachment ID.
$parent_idint-
Attachment parent ID.
Source
File: wp-admin/includes/media.php. View all references
do_action( 'wp_media_attach_action', $action, $attachment_id, $parent_id );
Related
Used By
| Used By | Description |
|---|---|
| wp_media_attach_action() wp-admin/includes/media.php | Encapsulates the logic for Attach/Detach actions. |
Changelog
| Version | Description |
|---|---|
| 5.5.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/wp_media_attach_action