wp_get_attachment_metadata
Filters the attachment meta data.
Использование
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 of meta data for the given attachment.
- $attachment_id(int)
- Attachment post ID.
Список изменений
С версии 2.1.0 | Введена. |
Где вызывается хук
wp_get_attachment_metadata
wp-includes/post.php 6782
return apply_filters( 'wp_get_attachment_metadata', $data, $attachment_id );