Created
April 20, 2020 12:19
-
-
Save mgibbs189/d5ea03bf73ebabde9f6a61c29ddc5837 to your computer and use it in GitHub Desktop.
FacetWP - index disabled variations (post_status = private)
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 to your (child) theme's functions.php | |
add_filter( 'facetwp_indexer_query_args', function( $args ) { | |
if ( in_array( 'product', (array) $args['post_type'] ) ) { | |
$args['post_status'] = [ 'publish', 'private' ]; | |
} | |
return $args; | |
}, 20 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment