Not Working in admin-ajax
-
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.phpfor the Ajax requests and your plugin wraps theadd_shortcodemethods 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-plusby also checking forwp_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,
The page I need help with: [log in to see the link]
The topic ‘Not Working in admin-ajax’ is closed to new replies.