Created
November 13, 2017 14:45
-
-
Save turtlepod/0dbfa9f0f1ddf61318ad61a088070952 to your computer and use it in GitHub Desktop.
Listify Snippet: Remove Location Facets
This file contains 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 | |
// Filter registered facets. | |
add_filter( 'facetwp_facets', function( $facets ) { | |
/** | |
* Loop each facets. | |
* Listify facets are "keyword", "location", and "category" | |
*/ | |
foreach ( $facets as $index => $facet ) { | |
// If facet name is "location", unset it. | |
if ( 'location' === $facet['name'] ) { | |
unset( $facets[ $index ] ); | |
} | |
} | |
return $facets; | |
}, 99 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment