Custom query user meta (3 posts)

  1. Allen Tullett
    Posted 5 years ago #

    Hi all

    I have successfully created some custom user meta fields, of which I can display on my site (i.e. on my author template). But I would like the ability to display a list of users with only a certain entry in one of the meta fields. For instance, on a page for 'Northgate' ward, I would like it to display the usernames of those users who have 'Northgate entered into the custom field of 'ward', and disregard all others.

    Can anybody help please.

    Many thanks


  2. ambrosite
    Posted 5 years ago #


  3. Mark / t31os

    Posted 5 years ago #

    I think when Allen mentioned meta he was refering to User Meta.

    You should be able to do user selection based on meta in 3.1 i believe, Scribu's gsoc project introduces the WP_User_Query class that can be used for querying for users, based on meta (or not).

    For a better idea of what i'm referring to, see the changeset that introduces the new WP_User_Query class here.

    Pre-3.1 you'll probably need to look at writing your own query to select users based on meta.

    For information on custom queries in WordPress, see.

Topic Closed

This topic has been closed to new replies.

About this Topic