MattPurland
Forum Replies Created
-
Forum: Plugins
In reply to: [Simple Custom Post Order] WordPress 6.7 SupportI’m getting this too on various sites updated to 6.7.1, had to disable until it’s fixed
Forum: Plugins
In reply to: [Termly - GDPR/CCPA Cookie Consent Banner] jQuery is not defined – solutionHi,
opr18 is correct. The script (add_js function in this case) is injecting the javascript before any queued javascript files. This produces the following scenario as part of wp_footer() (tidied up for eligibility):
<script type="text/javascript"> jQuery(document).ready(function($){ if(!catapultReadCookie("catAccCookies")){ // If the cookie has not been set then show the bar $("html").addClass("has-cookie-bar"); $("html").addClass("cookie-bar-bottom-bar"); $("html").addClass("cookie-bar-bar"); } }); </script> <script type='text/javascript' src='<domain></wp-includes/js/admin-bar.min.js?ver=4.4.2'></script> <script type='text/javascript' src='<domain>/wp-content/themes/<theme>/bower_components/jquery/dist/jquery.js?ver=2.1.1'></script>
This is due to the lack of priority on the action for add_js. Setting the priority of the jquery enqueue in functions.php doesn’t work, so the only solution is to add priority to the plugin add_action as per opr18’s suggestion.
Plugin author: I’d recommend adding priority 1000 to all actions in init() as per add_notification_bar to avoid this issue.
Using PayPal express it seems it’s worked for one my of colleagues but not for me. Any ideas why this would be the case?
FYI: when debugging you can see that all the other BP/BPS filters are available in $wp_filters, just not this one (there could be others, I’ve no idea).
If you’re curious I’ve been looking at function do_action_ref_array in wp-includes/plugin.php
If you debug the above you’ll notice the filter is missing in $wp_filters during AJAX calls.
WP: 4.1
BP: 2.1.1
BPS: 4.0.3I get this issue also, though my search form is already set to POST. The form doesn’t work at all when setting it to GET (clicking search redirects me back to the search form).
I’m stepping through the code and can see that upon the pagination AJAX call there’s a filter missing (bp_pre_user_query_construct) and so is not being run – this filter exists when posting the initial form, just not when using pagination (AJAX). From what I can tell, BPS uses this filter to apply the search terms against all users to get the user IDs needed for the main query. But during the paginated AJAX call the filter doesn’t exist and is skipped.
A quick look at the bps-search.php code will show you the filter being applied and removed before and after the members loop.
I’m pretty sure that makes sense.
Now, I’m no WP expert, WP baffles me on the best of days. I’ve dug as deep as I can go without my brain exploding, but if anyone understands this and knows how to get the filter to exist on AJAX calls, then we hopefully have a fix!
Any help would be appreciated, I’ve spent far too long trying to fix this. If any code snippets are needed or more info then please ask!