Description
Format the "thumb"Format the 'post' in a block or div with image with link only
Usage
bw_format_thumb( $post, $atts );Parameters
- $post
- ( object ) required – A post object
- $atts
- ( array ) required – Attributes array – passed from the shortcode Note: If the post_type is 'attachment' then we should not look for an attached image since this is probably already the attached image that we've loaded. Until we change this code the example won't work!
Returns
voidSource
File name: oik/shortcodes/oik-thumbs.phpLines:
1 to 19 of 19
function bw_format_thumb( $post, $atts ) { //setup_postdata( $post ); bw_trace( $post, __FUNCTION__, __LINE__, __FILE__, "post" ); $atts['title'] = get_the_title( $post->ID ); $thumbnail = bw_thumbnail( $post->ID, $atts ); $in_block = bw_validate_torf( bw_array_get( $atts, "block", false )); if ( $in_block ) { oik_require( "shortcodes/oik-blocks.php" ); e( bw_block( $atts )); bw_link_thumbnail( $thumbnail, $post->ID, $atts ); e( bw_eblock() ); } else { $class = bw_array_get( $atts, "class", "" ); sdiv( $class ); bw_link_thumbnail( $thumbnail, $post->ID, $atts ); //sediv( "cleared" ); ediv(); } }View on GitHub View on Trac
Invoked by
Calls
1 to 12 of 12
- bw_array_get() – Return the array[index] or array->index (for an object) or a default value if not set
- bw_block() –
- bw_eblock() –
- bw_format_thumb() – Format the "thumb"
- bw_link_thumbnail() – Create a thumbnail link
- bw_thumbnail() – Get the thumbnail of the specified size
- bw_trace() – Log a simple trace record to the trace log file if tracing is active
- bw_validate_torf() – Validate as true or false
- e() – Outputs some translated / non-translatable text
- ediv() – End a div
- oik_require() – Invoke require_once on an oik include file or other file
- sdiv() – Start a div
