• Resolved Yogesh

    (@yogeshbeniwal)


    While using Jetpack Instant Search is there any way to limit Search in Gutenberg block to specific category?

    Jetpack provide below filter, but then it also limit search capability for sitewide search box also.

    function jp_filter_query( $options ) {
        $options['adminQueryFilter'] = array(
            'bool' => array(
                'should' => array(
                    array( 'term' => array( 'category.slug' => 'categoryslug' ) ),
                )
            )
        );
        return $options;
    }
    add_filter( 'jetpack_instant_search_options', 'jp_filter_query' );
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Limit Search to specific category’ is closed to new replies.