Support

Account

Forum Replies Created

  • Hi @elliot,

    Thank you for continuing to research this issue for me. Since the solution at the URL you provided seemed to demonstrate another way to sort the rows in the users table in the Dashboard, I developed a custom solution to meet my requirements. In short, I added an “Advanced Search” page to the “Users” section of the Dashboard and had the page call a MySQL procedure that I wrote. You can find more information about the solution I developed at the URL below to the WordPress support forum.

    Thank you again for all of your help. Here is the URL.

    http://wordpress.org/support/topic/querying-the-wp_usermeta-table?replies=2

  • Hi @elliot,

    Yes, that is correct. Specifically, I want my custom search filter to filter the users in the search results based on data that is in the wp_usermeta table, in addition to the default behavior of filtering the results based on the data that is in the wp_users table.

  • Hi @elliot,

    Thank you, again, for continuing to work with me on this issue.

    I have read the threads at the URLs you posted. It seems the developers involved in the threads are trying to accomplish something different than what I am trying to do. I gather that they are trying to add a custom column to the users table in the Dashboard so that they can sort on the custom column. I, on the other hand, am trying to filter the entries in the table down to those who match the criteria I submit to the search form. I am thinking that sorting on a custom column will be a poor solution once the number of users gets large, i.e. 100, 500, 1000, 1000000. I want my administrators to only have to scan through the few user records that match their search criteria.

    Did I misunderstand the solutions proposed in the threads at the URLs you posted?

    Lastly, I should let you know that I have posted a more general question about this issue to the WP support forum. You can find my post at the URL below. My post has not yet received any replies.

    http://wordpress.org/support/topic/querying-the-wp_usermeta-table?replies=1

    Thank you.

  • Hi @elliot,

    The WP_User_Query class seems like a good way to search for users, but I currently do not see a way to make use of the class when an administrator searches for users in the Dashboard. If I were writing a separate search tool, the WP_User_Query class seems like it could work. But I want to tap into what WordPress already has in place.

    Do you have any suggestions for how I can extend the functionality of WordPress’s existing user search tool?

    A link to a pastebin of what I have in mind is below. (The code does not work as I expected it would.)

    http://pastebin.com/LuFeG1jg

  • Alright. That is helpful to know.

    I had a follow up question but I think I just answered it for myself. Let me do some additional research and see if I can develop a working solution. I plan on returning to the forum to ask an additional question or to mark this issue as resolved.

  • This is a different but related question. Is there a way to query the content of the custom fields that I have created when I perform a user search in the WordPress Dashboard (i.e. perform a search on the “/wp-admin/users.php” page)? For example, if I have created an “eye_color” custom field and type “brown” in my user search, is there a way to have ACF return all users with a “brown” eye color in my search results?

    (I can create a new thread if this question is significantly different than the original question.)

Viewing 7 posts - 1 through 7 (of 7 total)