Switch language

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




wp_get_attachment_thumb_file [ WordPress Function ]

wp_get_attachment_thumb_file ( $post_id = 0 )
Parameters:
  • (int) $post_id Attachment ID.
Returns:
  • (mixed) False on failure. Thumbnail file path on success.
Defined at:



Retrieve thumbnail for an attachment.

Source


<?php
function wp_get_attachment_thumb_file$post_id ) {
    
$post_id = (int) $post_id;
    if ( !
$post =& get_post$post_id ) )
        return 
false;
    if ( !
is_array$imagedata wp_get_attachment_metadata$post->ID ) ) )
        return 
false;

    
$file get_attached_file$post->ID );

    if ( !empty(
$imagedata['thumb']) && ($thumbfile str_replace(basename($file), $imagedata['thumb'], $file)) && file_exists($thumbfile) )
        return 
apply_filters'wp_get_attachment_thumb_file'$thumbfile$post->ID );
    return 
false;
}
?>

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