Support » Plugin: User Submitted Posts » Bug: Incomplete “Assigned Author” list on multisite

  • Resolved macoafi

    (@macoafi)


    In library/plugin-settings.php

    $user_count = count_users();

    returns the number of users on this particular site. In my case, that’s 3. However, it’s a multisite install. So, when we get here:

    $query = "SELECT ID, display_name FROM {$wpdb->users} LIMIT %d";

    it’s returning the first 3 users in the database, who are not the same 3 users that are on this site. Instead, use:

            if (is_multisite()) {
                    $query = "SELECT {$wpdb->users}.ID, {$wpdb->users}.display_name FROM {$wpdb->users}, {$wpdb->usermeta} WHERE {$wpdb->users}.ID = {$wpdb->usermeta}.user_id AND {$wpdb->usermeta}.meta_key=\"wp_{$wpdb->blogid}_user_level\" LIMIT %d";
            } else {
                    $query = "SELECT ID, display_name FROM {$wpdb->users} LIMIT %d";
            }
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Jeff Starr

    (@specialk)

    Thanks, this is very useful. Have you been using USP on Multisite? If so, is there anything else that needs updating? If you discover anything, please let me know so I can update the plugin. Cheers.

    Thread Starter macoafi

    (@macoafi)

    I just installed it tonight. Only found out about it from your Lynda course on plugin development 🙂 Other than this dropdown, it seems to work fine, though. Thanks for putting this together!

    Plugin Author Jeff Starr

    (@specialk)

    Awesome, thanks macoafi 🙂

    Plugin Author Jeff Starr

    (@specialk)

    Just to follow up, this has been implemented in the next version of USP. Thanks again, macoafi!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Bug: Incomplete “Assigned Author” list on multisite’ is closed to new replies.