Title: Calling plugin with do_shortcode doesn&#8217;t create Paypal object
Last modified: February 21, 2024

---

# Calling plugin with do_shortcode doesn’t create Paypal object

 *  Resolved [nils235](https://wordpress.org/support/users/nils235/)
 * (@nils235)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/calling-plugin-with-do_shortcode-doesnt-create-paypal-object/)
 * I had the problem that there was no Paypal JS object. 
   I found the culprit in`
   main.php`, line 139:—>`if(is_a($post, 'WP_Post')&& has_shortcode($post->post_content,'
   wp_paypal_checkout')|| has_shortcode(get_post_meta($post->ID, 'wp-paypal-custom-
   field', true), 'wp_paypal_checkout')){<—This doesn’t account for calling the 
   plugin with do_shortcode.I fixed it locally by removing the has_shortcode part.
 * Could you maybe include a fix in the code base, so I can savely install the next
   update without breaking things?

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

 *  Plugin Author [Noor Alam](https://wordpress.org/support/users/naa986/)
 * (@naa986)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/calling-plugin-with-do_shortcode-doesnt-create-paypal-object/#post-17444214)
 * Hi, Thanks for the feedback. We have added a new option to load the script on
   every page. You will find it in the settings after updating the plugin.
 *  Thread Starter [nils235](https://wordpress.org/support/users/nils235/)
 * (@nils235)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/calling-plugin-with-do_shortcode-doesnt-create-paypal-object/#post-17445214)
 * Thanks, Noor!
 * Keep up the awesome work!

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

The topic ‘Calling plugin with do_shortcode doesn’t create Paypal object’ is closed
to new replies.

 * ![](https://ps.w.org/wp-paypal/assets/icon-128x128.png?rev=2722398)
 * [Payment Button for PayPal](https://wordpress.org/plugins/wp-paypal/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-paypal/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-paypal/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-paypal/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-paypal/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-paypal/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [nils235](https://wordpress.org/support/users/nils235/)
 * Last activity: [2 years, 3 months ago](https://wordpress.org/support/topic/calling-plugin-with-do_shortcode-doesnt-create-paypal-object/#post-17445214)
 * Status: resolved