-
-
Save pije76/9faca9a8cfd27753d990e2cbd4855c00 to your computer and use it in GitHub Desktop.
facetwp uncheck parent checkbox
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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