WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
Line | Code |
---|---|
3844 | /** |
3845 | * Fires when media is attached or detached from a post. |
3846 | * |
3847 | * @since 5.5.0 |
3848 | * |
3849 | * @param string $action Attach/detach action. Accepts 'attach' or 'detach'. |
3850 | * @param int $attachment_id The attachment ID. |
3851 | * @param int $parent_id Attachment parent ID. |
3852 | */ |
3853 | do_action( 'wp_media_attach_action', $action, $attachment_id, $parent_id ); |
3854 |
|
3855 | clean_attachment_cache( $attachment_id ); |
3856 | } |
3857 |
|
3858 | $location = 'upload.php'; |
3859 | $referer = wp_get_referer(); |
3860 |
|
3861 | if ( $referer ) { |
3862 | if ( str_contains( $referer, 'upload.php' ) ) { |