Last active
November 4, 2015 16:51
-
-
Save mgibbs189/5cdea5f55f7352ca43aa to your computer and use it in GitHub Desktop.
FacetWP - prevent EDD wish list query
This file contains hidden or 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 | |
// Todo: change "edd_wish_list" to the correct post type | |
function fwp_ignore_edd_wishlist_query( $is_main_query, $query ) { | |
if ( isset( $query->query_vars['post_type'] && 'edd_wish_list' == $query->query_vars['post_type'] ) ) { | |
$is_main_query = false; // ignore the EDD Wish List query | |
} | |
return $is_main_query; | |
} | |
add_filter( 'facetwp_is_main_query', 'fwp_ignore_edd_wishlist_query', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Can't use isset on a comparison like this I don't believe.
This works:
if ( isset( $query->query_vars['post_type'] ) && 'edd_wish_list' == $query->query_vars['post_type'] ) {