wp_get_attachment_id3_keys

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

Description

apply_filters( 'wp_get_attachment_id3_keys', (array) $fields, (WP_Post) $attachment, (string) $context ); 

Parameters (3)

0. $fields (array)
Key/value pairs of field keys to labels.
1. $attachment (WP_Post)
Attachment object.
2. $context (string)
The context. Accepts edit,, display.. Default display..

Usage

To run the hook, copy the example below.
  1. $fields = apply_filters( 'wp_get_attachment_id3_keys', $fields, $attachment, $context ); 
  2.  
  3. if ( !empty( $fields ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the wp_get_attachment_id3_keys callback 
  2. function filter_wp_get_attachment_id3_keys( $fields, $attachment, $context ) { 
  3. // make filter magic happen here... 
  4. return $fields
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'wp_get_attachment_id3_keys', 'filter_wp_get_attachment_id3_keys', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'wp_get_attachment_id3_keys', 'filter_wp_get_attachment_id3_keys', 10, 3 ); 

Defined (1)

The filter is defined in the following location(s).

/wp-includes/media.php  
  1. return apply_filters( 'wp_get_attachment_id3_keys', $fields, $attachment, $context );