Created
July 24, 2018 17:49
-
-
Save djrmom/d44486615d69d64d2c0f68f0571b9938 to your computer and use it in GitHub Desktop.
facetwp check if a facet is in use
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
<script> | |
(function($) { | |
/** | |
* check if a facet exists and has value(s), change 'categories' to name of the facet being checked | |
*/ | |
$(document).on('facetwp-loaded', function() { | |
if ('undefined' !== typeof FWP.facets['categories'] && FWP.facets['categories'].length > 0 ) { | |
// do something if facet is in use | |
} | |
}); | |
})(jQuery); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment