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 Parameters


(string) Attach/detach action. Accepts 'attach' or 'detach'.


(int) The attachment ID.


(int) Attachment parent ID.

Top ↑

Source Source

File: wp-admin/includes/media.php

View on Trac

Top ↑

Changelog Changelog

Version Description
5.5.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.