Created
March 18, 2019 17:35
-
-
Save djrmom/f1197b6d566e97a3bd52059dd426066a 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