Ready to get started?Download WordPress


[resolved] Possible to extend WP_User_Query? (4 posts)

  1. Brayne
    Posted 3 years ago #

    In plain English, I need the ability to "Search Users" in the admin area to find a user by last name.

    I know there have been some issues with the User Search lately. I'm looking to extend the WP_User_Query to search the wp_usermeta table.

    For example append the query for something like... WHERE meta_key = 'last_name' AND meta_value LIKE

    I'm not looking for someone to write an SQL statement, but, has anyone come across this?

    From what I can tell in the file user.php (3.1) The user query only includes a search in wp_users in the following tables..


  2. DougJoseph
    Posted 3 years ago #

    I'm looking for the same thing. I was working on this by going after the WP_User_Search simply because I found it in the wp-admin side of the Users Search. (I later found it is currently deprecated from what I can tell.)

    I have found some code that looks promising as a start which I could tweak to get done what I need. I'm not real close just yet.

  3. Gonçalo Peres
    Posted 3 years ago #

    Take a look at my answer in this topic:

  4. Brayne
    Posted 3 years ago #

    See the code Gonçalo posted on the above link. perfect...resolved.

Topic Closed

This topic has been closed to new replies.

About this Topic