JW Player shortcode in ajax requests
-
Hello,
when loading WordPress content using AJAX requests the JW Player shortcode is not being replaced at all.I guess that is because in WordPress all ajax requests are handled by scripts which run as
is_admin() === true
and the plugin only adds the required shortcode filters when! is_admin()
. See this if block in your code: https://plugins.trac.www.ads-software.com/browser/jw-player-plugin-for-wordpress/tags/2.1.14/jwp6/jwp6-class-plugin.php#L474Note 2: Both front-end and back-end Ajax requests use admin-ajax.php so is_admin() will always return true in your action handling code. When selectively loading your Ajax script handlers for the front-end and back-end, and using the is_admin() function, your wp_ajax_(action) and wp_ajax_nopriv_(action) hooks MUST be inside the is_admin() === true part.
Best regards,
Alexhttps://www.ads-software.com/plugins/jw-player-plugin-for-wordpress/
- The topic ‘JW Player shortcode in ajax requests’ is closed to new replies.