This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: Allow search through "TermMeta" Database Table

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Allow search through "TermMeta" Database Table Reply To: Allow search through "TermMeta" Database Table

#18599
Ernest MarcinkoErnest Marcinko
Keymaster

Hi,

1. Try this one instead of the previous codes:

2. Might be possible actually. But please note, that this indexes the term meta with the associated posts, not with the terms, as the index table only supports custom post types.

Step 1
You will have to make a direct modification in one of the plugin core files to include an additional filter.
– Open up the wp-content\plugins\ajax-search-pro\includes\classes\etc\indextable.class.php file
– Find line 750, which should be this:
[php]$terms = wp_get_post_terms( $the_post->ID, trim( $taxonomy ), array( "fields" => "names" ) );[/php]
– Make a new line below it, and put this there:
[php]$terms = apply_filters("asp_index_terms", $terms, $taxonomy, $the_post);[/php]
– Save & Close

Step 2
Try the code below in the functions.php file in your theme directory. Don’t forget to change the $meta_keys and the $taxonomies array with the meta key names to look for, and the taxonomy names that should be affected.