Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




wp_get_attachment_metadata [ WordPress Function ]

wp_get_attachment_metadata ( $post_id = 0, $unfiltered = false )
Parameters:
  • (int) $post_id Attachment ID
  • (bool) $unfiltered Optional, default is false. If true, filters are not run.
Returns:
  • (string|bool) Attachment meta field. False on failure.
Defined at:



Retrieve attachment meta field for attachment ID.

Source


<?php
function wp_get_attachment_metadata$post_id 0$unfiltered false ) {
    
$post_id = (int) $post_id;
    if ( !
$post =& get_post$post_id ) )
        return 
false;

    
$data get_post_meta$post->ID'_wp_attachment_metadata'true );

    if ( 
$unfiltered )
        return 
$data;

    return 
apply_filters'wp_get_attachment_metadata'$data$post->ID );
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics