SearchWP

This Documentation is for SearchWP Version 3

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:

<?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 );
view raw functions.php hosted with ❤ by GitHub

Parameters

Parameter Type Description
$terms Array

Taxonomy terms for this post

$taxonomy String

Taxonomy of these terms

$post_being_indexed Object

Post being indexed