Support » Plugins » Subselect in plugin-query

  • Bram


    Hi again,

    Instead of editing the basic code of WordPress, as was my plan earlier today, I thought of a solution that involves a subselect in the query of the plugin.

    This plugin, WordPress Users (WPU), displays information on the registered users of the website on a given page. As I want to choose the order in which the users are display, I’ve added a custom profile-field ‘level’, that is stored into the wp_usermeta table.

    Below is the query of WPU that selects the users:
    SELECT ID, user_nicename FROM $wpdb->users WHERE ID = ANY (SELECT user_id FROM $wpdb->usermeta WHERE meta_value IN ($roles)) ORDER BY user_nicename LIMIT $offset, $usersPerPage

    Although I tried a few things, I can’t get it to ORDER BY the ‘level’-field in the wb_usermeta table. Maybe one of you can?

    Thanks in advance,

  • The topic ‘Subselect in plugin-query’ is closed to new replies.