wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
wp_get_attachment_metadata › WordPress Function
Seit2.1.0
Veraltetn/v
› wp_get_attachment_metadata ( $attachment_id = 0, $unfiltered = false )
| Parameter: (2) |
|
| Gibt zurück: |
|
| Definiert in: |
|
| Codex: | |
| Changelog: |
|
Retrieves attachment metadata for attachment ID.
Quellcode
function wp_get_attachment_metadata( $attachment_id = 0, $unfiltered = false ) {
$attachment_id = (int) $attachment_id;
if ( ! $attachment_id ) {
$post = get_post();
if ( ! $post ) {
return false;
}
$attachment_id = $post->ID;
}
$data = get_post_meta( $attachment_id, '_wp_attachment_metadata', true );
if ( ! $data ) {
return false;
}
if ( $unfiltered ) {
return $data;
}
/**
* Filters the attachment meta data.
*
* @since 2.1.0
*
* @param array $data Array of meta data for the given attachment.
* @param int $attachment_id Attachment post ID.
*/
return apply_filters( 'wp_get_attachment_metadata', $data, $attachment_id );
}