wp_get_attachment_metadata ( $attachment_id = 0, $unfiltered = false )

  • (int) attachment_id Attachment post ID. Defaults to global $post.
  • (bool) unfiltered Optional. If true, filters are not run. Default false.
  • (array|false) { Attachment metadata. False on failure. @type int $width The width of the attachment. @type int $height The height of the attachment. @type string $file The file path relative to `wp-content/uploads`. @type array $sizes Keys are size slugs, each value is an array containing 'file', 'width', 'height', and 'mime-type'. @type array $image_meta Image metadata. @type int $filesize File size of the attachment. }
Defined at:
Change Log:
  • 6: .


Retrieves attachment metadata for attachment ID.

Related Functions

wp_generate_attachment_metadata, wp_update_attachment_metadata, wp_maybe_generate_attachment_metadata, wp_get_attachment_image, wp_get_attachment_caption

Top Google Results

User discussions

wpseek mobile