Title: attachment_id3_data_meta_box
Published: April 25, 2014
Last modified: May 20, 2026

---

# attachment_id3_data_meta_box( WP_Post $post )

## In this article

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

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

Displays fields for ID3 data.

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

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

Current post object.

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

    ```php
    function attachment_id3_data_meta_box( $post ) {
    	$meta = array();
    	if ( ! empty( $post->ID ) ) {
    		$meta = wp_get_attachment_metadata( $post->ID );
    	}

    	foreach ( wp_get_attachment_id3_keys( $post, 'edit' ) as $key => $label ) :
    		$value = '';
    		if ( ! empty( $meta[ $key ] ) ) {
    			$value = $meta[ $key ];
    		}
    		?>
    	<p>
    		<label for="title"><?php echo $label; ?></label><br />
    		<input type="text" name="id3_<?php echo esc_attr( $key ); ?>" id="id3_<?php echo esc_attr( $key ); ?>" class="large-text" value="<?php echo esc_attr( $value ); ?>" />
    	</p>
    		<?php
    	endforeach;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/meta-boxes.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-admin/includes/meta-boxes.php#L1504)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-admin/includes/meta-boxes.php#L1504-L1522)

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

| Uses | 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.

  | 
| [wp_get_attachment_metadata()](https://developer.wordpress.org/reference/functions/wp_get_attachment_metadata/)`wp-includes/post.php` |

Retrieves attachment metadata for attachment ID.

  | 
| [esc_attr()](https://developer.wordpress.org/reference/functions/esc_attr/)`wp-includes/formatting.php` |

Escaping for HTML attributes.

  |

[Show 1 more](https://developer.wordpress.org/reference/functions/attachment_id3_data_meta_box/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/attachment_id3_data_meta_box/?output_format=md#)

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/attachment_id3_data_meta_box/?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%2Ffunctions%2Fattachment_id3_data_meta_box%2F)
before being able to contribute a note or feedback.