Skip to content

Instantly share code, notes, and snippets.

@mgibbs189
Created February 10, 2017 17:14
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save mgibbs189/bb92f8219608e47b5562a83503223d0e to your computer and use it in GitHub Desktop.
Save mgibbs189/bb92f8219608e47b5562a83503223d0e to your computer and use it in GitHub Desktop.
FacetWP - WooCommerce Memberships fix
<?php
add_filter( 'facetwp_is_main_query', function( $is_main_query, $query ) {
if ( 'wc_user_membership' == $query->get( 'post_type' ) ) {
$is_main_query = false;
}
return $is_main_query;
}, 10, 2 );
@lkraav
Copy link

lkraav commented Sep 11, 2019

@mgibbs189 curious, do you happen to have any medicine for facet counts not respecting membership access rules?

image

Filters show numbers, but in reality the user can't see or list any of the items. How do we fix the counts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment