• Hi,
    I am the author of the Ajax Load More plugin, I have users unable to use our two plugins together.

    After running some tests and debugging the plugin code it appears the issue is related to the fact Ajax Load More uses admin-ajax.php for the Ajax requests and your plugin wraps the add_shortcode methods and script enqueues in !is_admin() check functions.

    This results in users are being shown plain text shortcodes as they are not loaded in Ajax requests.

    I was able to fix this on a local copy of youtube-embed-plus by also checking for wp_doing_ajax() and loading these scripts and shortcodes if so.

    for example, line 1970 of youtube.php
    if (!is_admin() || (self::$alloptions[self::$opt_frontend_only] != 1))
    becomes:
    if (!is_admin() || (self::$alloptions[self::$opt_frontend_only] != 1) || wp_doing_ajax())

    Let me know if this is something you have come across before and if it’s possible to get our plugins working together. If the plugin is on Github I could send in a pull request.

    Let me know if you have any questions.

    thanks,

    • This topic was modified 4 years, 10 months ago by Darren Cooney.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author embedplus

    (@embedplus)

    Thanks. We’ll test it incorporate a solution.

    Plugin Author embedplus

    (@embedplus)

    It seems that your users would only have an issue if they checked the “Turn Off Scripts While Editing” option, correct? If so, unfortunately your proposed fix would bypass that user’s desired option. Many pagebuilders and editors use AJAX, so for those users, adding that third conditional would make the logic always enter the block even if those particular users have that option checked. We’ll think of another solution that may encompass your and other possible situations.

    Thread Starter Darren Cooney

    (@dcooney)

    Thanks. I didn’t know about this setting I just tested and it works with that turned off.

    Just need to get the responsive working. Is there a public function to trigger your implementation of fitvids?

    Thanks for your help!

    Plugin Author embedplus

    (@embedplus)

    Please tell your users to try out the Ajax Theme feature in the Compatibility tab of our plugin.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Not Working in admin-ajax’ is closed to new replies.