Available since: 2.7
searchwp_indexer_taxonomy_terms
View Parameters »Note: Use of this hook will require a manual reindex
When a taxonomy has been added to an engine configuration, SearchWP will retrieve all taxonomy terms for that taxonomy when indexing a post. You can use this hook to modify the taxonomy terms for the post being index once they have been retrieved:
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 | |
// Modify taxonomy terms for posts during SearchWP indexing. | |
add_filter( 'searchwp_indexer_taxonomy_terms', function( $terms, $taxonomy, $post_being_indexed ) { | |
// TODO: modify $terms in any way you'd like. | |
return $terms; | |
}, 20, 3 ); |
Parameters
Parameter | Type | Description |
---|---|---|
$terms |
Array |
Taxonomy terms for this post |
$taxonomy |
String |
Taxonomy of these terms |
$post_being_indexed |
Object |
Post being indexed |