You appear to be a bot. Output may be restricted
Description
Implement [bw_qrcode] shortcode to display the QR code file with a link if requiredNotes: the attribute defaulting needs to be improved
Usage
bw_qrcode( $atts );
Parameters
- $atts
- ( mixed ) required –
Returns
voidSource
File name: oik/shortcodes/oik-qrcode.phpLines:
1 to 25 of 25
function bw_qrcode( $atts ) { $link = bw_array_get( $atts, 'link', null ); $company = bw_get_option( "company" ); $text = bw_array_get( $atts, 'text', $company ); $width = bw_array_get( $atts, 'width', null ); $height = bw_array_get( $atts, 'height', null ); $upload_dir = wp_upload_dir(); $baseurl = $upload_dir['baseurl']; $logo_image = bw_get_option( "qrcode-image" ); $image_url = $baseurl . $logo_image; /* translators: %s: company name */ $image = retimage( NULL, $image_url, sprintf( __( 'QR code for %1$s', "oik" ), $text ) , $width, $height ); if ( $link ) { BW_::alink( NULL, $link, $image, $company ); } else { e( $image ); } return( bw_ret()); }View on GitHub View on Trac