Available since: 2.5
searchwp_indexer_taxonomies
View Parameters »By default SearchWP will index all available taxonomies. If you would like to customize which taxonomies are indexed by SearchWP you can use this hook to do so.
To customize which taxonomies are indexed by SearchWP, add something like the following to your theme’s functions.php:
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 | |
function my_searchwp_indexer_taxonomies( $taxonomies, $post_being_indexed ) { | |
// TODO: customize which taxonomies are indexed | |
return $taxonomies; | |
} | |
add_filter( 'searchwp_indexer_taxonomies', 'my_searchwp_indexer_taxonomies', 10, 2 ); |
Parameters
Parameter | Type | Description |
---|---|---|
$taxonomies |
Array |
The taxonomy names to index |
$post_being_indexed |
Object |
The post object being indexed |