You appear to be a bot. Output may be restricted
Description
Create a direct link to the attached file rather than a permalink to the attachment
Usage
bw_link_attachment( $post, $atts );
Parameters
- $post
- ( object ) required – the post for the attached file
- $atts
- ( array ) required – the shortcode parameters If there is no attached file for the $post then something is wrong – create a trace record
Returns
voidSource
File name: oik/shortcodes/oik-attachments.phpLines:
1 to 10 of 10
function bw_link_attachment( $post, $atts ) { $file = get_post_meta( $post->ID, "_wp_attached_file", true ); if ( $file ) { $upload_dir = wp_upload_dir(); $file = $upload_dir['baseurl'] . '/' . $file; BW_::alink( "bw_attachment", $file , $atts['title'], null, "link-".$post->ID ); } else { bw_trace2(); } }View on GitHub View on Trac