Skip to content

Instantly share code, notes, and snippets.

@jchristopher
Last active June 18, 2022 01:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jchristopher/0ecc4c6ed172f64e7a97748026266e32 to your computer and use it in GitHub Desktop.
Save jchristopher/0ecc4c6ed172f64e7a97748026266e32 to your computer and use it in GitHub Desktop.
<?php
// Tell SearchWP to index only taxonomy term names instead of the entire WP_Term.
add_filter( 'searchwp\source\post\attributes\taxonomy\terms', function( $terms ) {
return array_map( function( $term ) {
return $term->name;
}, $terms );
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment