Last active
June 25, 2019 21:09
-
-
Save mgibbs189/768a80cf21fa92cc4d46227f1ab9bd64 to your computer and use it in GitHub Desktop.
FacetWP - compare different facets in "OR" mode (experimental)
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 | |
add_filter( 'facetwp_filtered_post_ids', function( $post_ids, $class ) { | |
if ( ! empty( FWP()->or_values ) ) { | |
$post_ids = []; | |
foreach ( FWP()->or_values as $facet_name => $matches ) { | |
foreach ( $matches as $match ) { | |
$post_ids[] = $match; | |
} | |
} | |
$post_ids = array_unique( $post_ids ); | |
} | |
return $post_ids; | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment