This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Javascript API hook

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #35964
    bar97298bar97298
    Participant

    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?

    #35967
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi!

    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:

    // Manually load the wp-hooks script.
    wp_enqueue_script( 'wp-hooks' );
    #36008
    bar97298bar97298
    Participant

    Hi!
    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.

    #36009
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    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
    That should prevent triggering the closing event on the outside elements.

    #36034
    bar97298bar97298
    Participant

    Hi, many thanks for the lovely support.
    We managed to fix it with your help.

    Have a wonderful day.

    #36035
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.