Answer the question
In order to leave comments, you need to log in
WP Extended Search, how to add search in custom meta fields of custom taxonomy?
I am using the WP Extended Search plugin. For custom taxonomy, a custom metafield (textarea) with a visual editor has been added. The search plugin itself does not know how to search for custom meta fields in taxonomies.
I need to search in the texts of this custom taxonomy custom metafield.
I added a hook to the functions.php file of the theme, now in the search plugin settings I can select a custom meta field to search by (put a bird, search in this meta field):
function wpes_meta_keys_query($query) {
global $wpdb;
$query = "select DISTINCT meta_key from $wpdb->termmeta ORDER BY meta_key ASC";
return $query;
}
add_filter('wpes_meta_keys_query', 'wpes_meta_keys_query');
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question