wp_get_attachment_metadata
Filters the attachment meta data.
Usage
add_filter( 'wp_get_attachment_metadata', 'wp_kama_get_attachment_metadata_filter', 10, 2 ); /** * Function for `wp_get_attachment_metadata` filter-hook. * * @param array $data Array of meta data for the given attachment. * @param int $attachment_id Attachment post ID. * * @return array */ function wp_kama_get_attachment_metadata_filter( $data, $attachment_id ){ // filter... return $data; }
- $data(array)
- Array of meta data for the given attachment.
- $attachment_id(int)
- Attachment post ID.
Changelog
Since 2.1.0 | Introduced. |
Where the hook is called
wp_get_attachment_metadata
wp-includes/post.php 6613
return apply_filters( 'wp_get_attachment_metadata', $data, $attachment_id );