Switch language

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




wp_get_attachment_thumb_url [ WordPress Function ]

wp_get_attachment_thumb_url ( $post_id = 0 )
Parameters:
  • (int) $post_id Attachment ID
Returns:
  • (string|bool) False on failure. Thumbnail URL on success.
Defined at:



Retrieve URL for an attachment thumbnail.

Source


<?php
function wp_get_attachment_thumb_url$post_id ) {
    
$post_id = (int) $post_id;
    if ( !
$post =& get_post$post_id ) )
        return 
false;
    if ( !
$url wp_get_attachment_url$post->ID ) )
        return 
false;

    
$sized image_downsize$post_id'thumbnail' );
    if ( 
$sized )
        return 
$sized[0];

    if ( !
$thumb wp_get_attachment_thumb_file$post->ID ) )
        return 
false;

    
$url str_replace(basename($url), basename($thumb), $url);

    return 
apply_filters'wp_get_attachment_thumb_url'$url$post->ID );
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



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