Ignore WooCommerce Membership product restrictions when facets are used on Shop page.

mgibbs189

{{gist file=”functions.php” lang=”php”}}
<?php

/**
* Ignore WooCommerce Membership product restrictions when facets are used on Shop page.
*
* @uses FacetWP
* @uses WooCommerce Memberships
*/
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 );

{{/gist}}