Skip to content

Instantly share code, notes, and snippets.

@fcrespo82
Created April 17, 2013 18:17
Show Gist options
  • Save fcrespo82/5406500 to your computer and use it in GitHub Desktop.
Save fcrespo82/5406500 to your computer and use it in GitHub Desktop.
QR code shortcode for wordpress
<?php
function qr($atts, $content=null) {
extract(shortcode_atts( array('url' => ''), $atts));
$googleurl = 'https://chart.googleapis.com/chart?chs=250x250&cht=qr&chl=' . urlencode($url);
return '<img src="' . $googleurl . '" />';
}
add_shortcode('qr', 'qr');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment