Title: Using Shortcode Inside Another Plugin
Last modified: July 7, 2024

---

# Using Shortcode Inside Another Plugin

 *  Resolved [paulfitzwordpress](https://wordpress.org/support/users/paulfitzwordpress/)
 * (@paulfitzwordpress)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/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](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:
 *     ```wp-block-code
       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:
 *     ```wp-block-code
       <!-- 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)

 *  Thread Starter [paulfitzwordpress](https://wordpress.org/support/users/paulfitzwordpress/)
 * (@paulfitzwordpress)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/using-shortcode-inside-another-plugin/#post-17880566)
 * Could my issue relate to the plugin not loading the necessary javascript files?
   Any steps I can take?
 *  Plugin Author [Kaya Studio](https://wordpress.org/support/users/kayastudio/)
 * (@kayastudio)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/using-shortcode-inside-another-plugin/#post-17883564)
 * Hello,
   Thank you for your comment and for using ‘Kaya QR Code Generator’.
 * Yes indeed, in order to function correctly, all my plugin files must be loaded,
   including JavaScript files.
 * The image of the QR Code, and therefore the ‘source’ field of the img tag, is
   generated by my JavaScript functions after processing the shortcode via PHP.
 * I hope this is useful to you, don’t hesitate if you have any other questions,
   or to mark the topic as resolved if so.
 * Thank you, kind regards.
 *  Thread Starter [paulfitzwordpress](https://wordpress.org/support/users/paulfitzwordpress/)
 * (@paulfitzwordpress)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/using-shortcode-inside-another-plugin/#post-17887145)
 * Thanks for the response. Would I need to just include the JS files or other files
   as well? If I need to include other files, which ones specifically?
 * Thanks in advance.
 *  Thread Starter [paulfitzwordpress](https://wordpress.org/support/users/paulfitzwordpress/)
 * (@paulfitzwordpress)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/using-shortcode-inside-another-plugin/#post-17887244)
 * It’s ok, I’ve decided to use another option for it, thanks.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Using Shortcode Inside Another Plugin’ is closed to new replies.

 * ![](https://ps.w.org/kaya-qr-code-generator/assets/icon-256x256.png?rev=2203917)
 * [Kaya QR Code Generator](https://wordpress.org/plugins/kaya-qr-code-generator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/kaya-qr-code-generator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/kaya-qr-code-generator/)
 * [Active Topics](https://wordpress.org/support/plugin/kaya-qr-code-generator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/kaya-qr-code-generator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/kaya-qr-code-generator/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [paulfitzwordpress](https://wordpress.org/support/users/paulfitzwordpress/)
 * Last activity: [1 year, 11 months ago](https://wordpress.org/support/topic/using-shortcode-inside-another-plugin/#post-17887244)
 * Status: resolved