Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Javascript API hook
This topic contains 5 replies, has 2 voices, and was last updated by Ernest Marcinko 1 year, 3 months ago.
- AuthorPosts
- December 15, 2021 at 10:55 am #35964
Hi. We tried to use the javascript API to hook into asp_redirect_url to change the query structure of results page as so:
$(document).ready(function(){
wp.hooks.addFilter(‘asp_redirect_url’, ‘asp’, function(url) {
// query manipulations
}
}
Everything is working fine then the user is logged in, but for not logged in user the global wp.hooks is undefined. Is there a setting that restricts wp.hooks for not logged-in users?December 15, 2021 at 1:52 pm #35967Hi!
Maybe the wp-hooks script is not enqueued on the front-end when logged out. Try adding this to the functions.php file in your theme directory:
Best,// Manually load the wp-hooks script. wp_enqueue_script( 'wp-hooks' );
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
December 20, 2021 at 11:36 am #36008Hi!
First of all, thank you very much for your help and support we manage to fix the issue.We’ve come across another issue and I hope you are able to support this one as well.
We use the Ajax Search Plugin inside the Elementor popup – any click on the search filter closes the Elementor popup. Is there a safe way to stop click propagation from search to Elementor popup?Thank you and have a good day.
December 20, 2021 at 12:19 pm #36009Hi,
You are very welcome!
Try turning on the overlay and esc key closing prevention on the Elementor popup settings: https://i.imgur.com/Jv9sC6l.png
Best,
That should prevent triggering the closing event on the outside elements.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
December 22, 2021 at 10:10 am #36034Hi, many thanks for the lovely support.
We managed to fix it with your help.Have a wonderful day.
December 22, 2021 at 10:32 am #36035You cannot access this content. Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
You must be logged in to reply to this topic.