FacetWP breaks jQuery events

Okay, to answer my own question – I just had to rewrite the function and use .on(), as it listens to changes in the DOM. Like this: $(document).on( ‘click’, ‘.email’, function() { var $this = $(this); $this.parent().toggleClass(‘open’); }); Inspired by this piece of documentation: https://facetwp.com/use-jquery-on-instead-of-click/

How to set variables with AJAX request to use in another function in WordPress

There are two issues Broken Callbacks You’ve used: add_action(‘wp_ajax_nopriv_my_php_ajax_function’,’my_php_ajax_function’ ); This is equivalent to: When `wp_ajax_nopriv_my_php_ajax_function` happens do: `my_php_ajax_function()` Which is not what you wanted, because that is not a function, and there is no my_php_ajax_function function. You also don’t just want it on that class, you want it on that specific instance of that … Read more