Created
June 19, 2017 17:01
-
-
Save JiveDig/0cea8402b629129bf5d0a5911ad162d4 to your computer and use it in GitHub Desktop.
Ignore WooCommerce Membership product restrictions when facets are used on Shop page.
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 | |
/** | |
* 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 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment