SearchWP

Available since: 2.8.7

searchwp_indexer_taxonomy_term_index_slug

View Parameters »

Note: Use of this hook will require a manual reindex

By default SearchWP indexes only the taxonomy term name when indexing taxonomies that have been added to any engine configuration. A common need is to also index the taxonomy term slug as well, which you can do by adding this to your theme’s functions.php:

<?php
// Tell SearchWP to index taxonomy term slugs alongside the taxonomy term name.
add_filter( 'searchwp_indexer_taxonomy_term_index_slug', '__return_true' );
view raw functions.php hosted with ❤ by GitHub

Parameters

Parameter Type Description
$index_slug Boolean

Whether to index the term slug

$context Array

$context['SWP'] The SearchWP instance
$context['taxonomy'] The taxonomy being indexed
$context['term'] The term being indexed