wppaste
WordPress

apply_filters( 'wp_edited_image_metadata', array $new_image_meta, int $new_attachment_id, int $attachment_id )

Since
5.5.0
Filters the meta data for the new image created by editing an existing image.

Compatibility

WordPress
since 5.5.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$new_image_metaarray
Meta data for the new image.
$new_attachment_idint
Attachment post ID for the new image.
$attachment_idint
Attachment post ID for the edited (parent) image.

Where this hook fires · 1

  • wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php:851WP_REST_Attachments_Controller::edit_media_item()

Source code

		 * @since 5.5.0		 *		 * @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.		 */		$new_image_meta = apply_filters( 'wp_edited_image_metadata', $new_image_meta, $new_attachment_id, $attachment_id ); 		wp_update_attachment_metadata( $new_attachment_id, $new_image_meta ); 		$response = $this->prepare_item_for_response( get_post( $new_attachment_id ), $request );		$response->set_status( 201 );		$response->header( 'Location', rest_url( sprintf( '%s/%s/%s', $this->namespace, $this->rest_base, $new_attachment_id ) ) );

Changelog

Introduced in 5.5.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.0.4 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.