Using Shortcode Inside Another Plugin
-
I am developing a stock re-ordering system in Woocommerce. Ideally I’d like to use the Kaya shortcode plugin to generate QR codes for re-ordering.
I just need the QR code to redirect people to a url similar to https://www.mysite.com/wp-admin/admin.php?page=woo-qr-stock-manager&product_id=149207
The challenge I have is that when I call the shortcode from inside my plugin, it doesn’t include an image source.
Example code below, great plugin by the way.
Inside my plugin I am using:
if ( shortcode_exists( 'kaya_qrcode_dynamic' ) ) {
echo do_shortcode( '[kaya_qrcode_dynamic title="Test Code" title_align="alignnone" querystring="page=woo-qr-stock-manager&product_id=" ecclevel="L" new_window="1" download_button="1" download_text="Download" download_align="alignnone"]https://www.mysite.com.au/wp-admin/admin.php[/kaya_qrcode_dynamic]' );
} else {
echo ("No Plugin shortcode exists!\n");
}This generates:
<!-- START Kaya QR Code Generator --><div class="wpkqcg_qrcode_wrapper"><input type="hidden" id="wpkqcg_qrcode_outputimg_73668a20a0b477c50_ecclevel" value="L" /><input type="hidden" id="wpkqcg_qrcode_outputimg_73668a20a0b477c50_size" value="" /><input type="hidden" id="wpkqcg_qrcode_outputimg_73668a20a0b477c50_border" value="4" /><input type="hidden" id="wpkqcg_qrcode_outputimg_73668a20a0b477c50_color" value="#000000" /><input type="hidden" id="wpkqcg_qrcode_outputimg_73668a20a0b477c50_bgcolor" value="#FFFFFF" /><input type="hidden" id="wpkqcg_qrcode_outputimg_73668a20a0b477c50_content" value="https://www.mysite/wp-admin/admin.php?page=woo-qr-stock-manager" /><img src="" id="wpkqcg_qrcode_outputimg_73668a20a0b477c50" alt="QR Code" class="wpkqcg_qrcode" style="width: auto; height: auto; max-width: 100%;" ><div style="clear: none;"></div></div><!-- END Kaya QR Code Generator -->
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.