WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/20/2010 08:43:32 PM (11 years ago)
Author:
ryan
Message:

Add query args argument to get_users_of_blog(). Limit number of users fetched for user lists in sites table and edit blog form. see #15053

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/network/sites.php

    r15759 r15876  
    258258
    259259                // Site users
    260                 $blogusers = get_users_of_blog( $id );
    261 
     260                $blogusers = get_users_of_blog( $id, array('number' => 20) );
    262261                if ( is_array( $blogusers ) ) {
    263262                    echo '<div id="blogedit_blogusers" class="postbox"><h3 class="hndle"><span>' . __( 'Site Users' ) . '</span></h3><div class="inside">';
    264263                    echo '<table class="form-table">';
    265264                    echo "<tr><th>" . __( 'User' ) . "</th><th>" . __( 'Role' ) . "</th><th>" . __( 'Password' ) . "</th><th>" . __( 'Remove' ) . "</th></tr>";
     265                    $user_count = 0;
    266266                    foreach ( $blogusers as $user_id => $user_object ) {
     267                        $user_count++;
    267268                        $existing_role = reset( $user_object->roles );
    268269
     
    291292                    echo "</table>";
    292293                    echo '<p class="submit" style="text-align:center;"><input type="submit" name="Submit" value="' . esc_attr__( 'Update Options' ) . '" /></p>';
     294                    if ( 20 == $user_count )
     295                        echo '<p>' . sprintf( __('First 20 users shown. <a href="%s">Manage all users</a>.'), get_admin_url($id, 'users.php') ) . '</p>';
    293296                    echo "</div></div>";
    294297                }
Note: See TracChangeset for help on using the changeset viewer.