Skip to content

Instantly share code, notes, and snippets.

@mgibbs189
Created April 20, 2020 12:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgibbs189/d5ea03bf73ebabde9f6a61c29ddc5837 to your computer and use it in GitHub Desktop.
Save mgibbs189/d5ea03bf73ebabde9f6a61c29ddc5837 to your computer and use it in GitHub Desktop.
FacetWP - index disabled variations (post_status = private)
<?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