Skip to content

Instantly share code, notes, and snippets.

@pije76
Forked from djrmom/custom-hooks.php
Created July 18, 2019 13:28
Show Gist options
  • Save pije76/9faca9a8cfd27753d990e2cbd4855c00 to your computer and use it in GitHub Desktop.
Save pije76/9faca9a8cfd27753d990e2cbd4855c00 to your computer and use it in GitHub Desktop.
facetwp uncheck parent checkbox
<?php
/** uncheck the parent when checking a child checkbox **/
add_action( 'wp_footer', function() { ?>
<script>
(function($) {
$(document).on('click', '.facetwp-depth .facetwp-checkbox', function() {
if ( $( this ).hasClass( "checked" ) ) {
$(this).parent().prev().removeClass('checked');
FWP.autoload();
};
});
})(jQuery);
</script>
<?php }, 100 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment