• this works exactly as described. it would be even better if the content of the [qrcode] shortcode could be another shortcode, e.g.

    [qrcode][field url][\qrcode]

    Heres the PHP that’ll make it do that:

    function qrcode( $atts, $content = null ) {
        return '<div id="qrcode"></div>
    <script type="text/javascript">
    new QRCode(document.getElementById("qrcode"), "'.do_shortcode($content).'");
    </script>';
    }
    
    add_shortcode("qrcode", "qrcode");

  • The topic ‘really great; just needs 1 tweak’ is closed to new replies.