wp_edited_image_metadata
Filters the meta data for the new image created by editing an existing image.
Usage
add_filter( 'wp_edited_image_metadata', 'wp_kama_edited_image_metadata_filter', 10, 3 );
/**
* Function for `wp_edited_image_metadata` filter-hook.
*
* @param array $new_image_meta Meta data for the new image.
* @param int $new_attachment_id Attachment post ID for the new image.
* @param int $attachment_id Attachment post ID for the edited (parent) image.
*
* @return array
*/
function wp_kama_edited_image_metadata_filter( $new_image_meta, $new_attachment_id, $attachment_id ){
// filter...
return $new_image_meta;
}
- $new_image_meta(array)
- Meta data for the new image.
- $new_attachment_id(int)
- Attachment post ID for the new image.
- $attachment_id(int)
- Attachment post ID for the edited (parent) image.
Changelog
| Since 5.5.0 | Introduced. |
Where the hook is called
wp_edited_image_metadata
wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php 793
$new_image_meta = apply_filters( 'wp_edited_image_metadata', $new_image_meta, $new_attachment_id, $attachment_id );