1

I’m building a search form with meta_query to get users based on meta_key and meta_value.

Some meta_key are taxonomies.

It works very well but in my select, i have all terms and some terms are not used by users but by post_type or buddypress group.

I get all terms this way :

$genres = get_terms(array(
    'taxonomy' => 'genre',
    'orderby' => 'name',
    'order' => 'ASC',
    'hide_empty' => false,
        ));

But i want to get only the terms associated with users (for example the terms are in usermeta with meta_key = user_type_film

For post type, it’s easy but i can find a solution for users.

Is there a WordPress method to do that ? I’ve searched in the codex and i don’t see what I'm looking for . Do i need to build my custom sql query ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.