You appear to be a bot. Output may be restricted
Description
Return the source file name for the appropriately sized thumbnail image
Usage
$array = bw_get_thumbnail_src( $post_id, $size );
Parameters
- $post_id
- ( ID ) required – ID of the attached image
- $size
- ( string|array ) required – the required thumbnail size
Returns
array array of the attached images array, which consists of url, width, heightTO DO
handle the post_id being the actual post ID of the imageSource
File name: oik/includes/bw_images.incLines:
1 to 12 of 12
function bw_get_thumbnail_src( $post_id, $size ) { $thumb_id = get_post_thumbnail_id( $post_id ); if ( $thumb_id ) { $thumbnail = wp_get_attachment_image_src( $thumb_id, $size ) ; } elseif ( $arr_thumb = bw_get_attached_image( $post_id, 1, 'rand', $size )) { //bw_trace( $arr_thumb, __FUNCTION__, __LINE__, __FILE__, "arr_thumb" ); $thumbnail = $arr_thumb[0]; } else { $thumbnail = false; } return( $thumbnail ); }View on GitHub View on Trac