// facetwp_indexer_query_args

Overview

This filter lets you customize which posts get indexed. You have access to the Query Arguments array that gets passed to WP_Query.

Parameters

  • $args | array | An array of WP_Query arguments (see below)

$args = array(
    'post_type'         => 'any',
    'post_status'       => 'publish',
    'posts_per_page'    => -1,
    'fields'            => 'ids',
);

Usage

// Index attachments (post_status = inherit)
add_filter( 'facetwp_indexer_query_args', function( $args ) {
    $args['post_status'] = array( 'publish', 'inherit' );
    return $args;
});