Title: wp_get_attachment_id3_keys
Published: April 25, 2014
Last modified: August 20, 2026

---

# apply_filters( ‘wp_get_attachment_id3_keys’, array $fields, WP_Post $attachment, string $context )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/hooks/wp_get_attachment_id3_keys/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/wp_get_attachment_id3_keys/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/wp_get_attachment_id3_keys/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/wp_get_attachment_id3_keys/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/hooks/wp_get_attachment_id3_keys/?output_format=md#wp--skip-link--target)

Filters the editable list of keys to look up data from an attachment’s metadata.

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/wp_get_attachment_id3_keys/?output_format=md#parameters)󠁿

 `$fields`array

Key/value pairs of field keys to labels.

`$attachment`[WP_Post](https://developer.wordpress.org/reference/classes/wp_post/)

Attachment object.

`$context`string

The context. Accepts `'edit'`, `'display'`. Default `'display'`.

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/wp_get_attachment_id3_keys/?output_format=md#source)󠁿

    ```php
    return apply_filters( 'wp_get_attachment_id3_keys', $fields, $attachment, $context );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/media.php#L3509)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/media.php#L3509-L3509)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/wp_get_attachment_id3_keys/?output_format=md#related)󠁿

| Used by | Description | 
| [wp_get_attachment_id3_keys()](https://developer.wordpress.org/reference/functions/wp_get_attachment_id3_keys/)`wp-includes/media.php` |

Returns useful keys to use to lookup data from an attachment’s stored metadata.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/wp_get_attachment_id3_keys/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.9.0](https://developer.wordpress.org/reference/since/3.9.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwp_get_attachment_id3_keys%2F)
before being able to contribute a note or feedback.