WordPress.org

Ready to get started?Download WordPress

Forums

WP Stripe
[resolved] Shortcode not adding necessary thickbox js or css, only in sidebar (3 posts)

  1. joelandrewbrown
    Member
    Posted 2 years ago #

    I have two examples here:

    Ex. 1:
    This page has the [wp-stripe] shortcode in the main content as well in the sidebar. This example works just fine, including the proper css and js for the donate pop up to work properly.

    Ex. 2:
    This page only has the [wp-stripe] included in the sidebar (click the 2nd Donate now button from the top). You'll notice in this example that the popup does not work. This is because, for some reason, the css and js are not being included.

    We've tried de-activating all other plugins. We've confirmed that in Ex. 2, if we put a [wp-stripe] in the main content, then both start working.

    Any ideas why the proper css and js are not included when the [wp-stripe] shortcode is only in the sidebar?

    Thanks in advance! This plugin is great, this is the only trip-up we've had so far.

    http://wordpress.org/extend/plugins/wp-stripe/

  2. joelandrewbrown
    Member
    Posted 2 years ago #

    So, we figured out our particular issue. On line 108 of wp-stripe.php:

    wp_enqueue_script('thickbox');

    is wrapped in

    if (is_singular() && strpos($post->post_content,'stripe') !== false) {

    In our case, removing the if statement allowed the donate pop up (in the sidebar) to function properly. I can't explain exactly why, any ideas? We were curious what the purpose of that if statement was exactly.

    Thanks for the awesome plugin!

  3. Noel Tock
    Human Made
    Plugin Author

    Posted 2 years ago #

    Hi Joel,

    Good job on replying before me :) Basically the if statement serves to check if the post content contains the word stripe, so that everything is only loaded on the necessary pages (though I could probably do a better job to make it compatible with widgets too). Will fix in the next release!

    Cheers!

    Noel

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags