Javascript API hook

This topic contains 5 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 9 months, 2 weeks ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #35964
    bar97298
    bar97298
    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 Marcinko
    Ernest 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' );
    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #36008
    bar97298
    bar97298
    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 Marcinko
    Ernest 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.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #36034
    bar97298
    bar97298
    Participant

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

    Have a wonderful day.

    #36035
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.