WordPress.org

Ready to get started?Download WordPress

Forums

Custom query user meta (3 posts)

  1. Allen Tullett
    Member
    Posted 3 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

    Allen

  2. ambrosite
    Member
    Posted 3 years ago #

    n/m

  3. Mark / t31os
    Moderator
    Posted 3 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.
    http://core.trac.wordpress.org/changeset/15491

    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.
    http://codex.wordpress.org/Function_Reference/wpdb_Class

Topic Closed

This topic has been closed to new replies.

About this Topic