- Timestamp:
- 06/10/2015 06:49:38 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-ms-sites-list-table.php
r32664 r32718 112 112 $query .= ' ORDER BY last_updated '; 113 113 } elseif ( $order_by == 'blogname' ) { 114 if ( is_subdomain_install() ) 114 if ( is_subdomain_install() ) { 115 115 $query .= ' ORDER BY domain '; 116 else116 } else { 117 117 $query .= ' ORDER BY path '; 118 } 118 119 } elseif ( $order_by == 'blog_id' ) { 119 120 $query .= ' ORDER BY blog_id '; … … 183 184 */ 184 185 public function get_columns() { 185 $blogname_columns = ( is_subdomain_install() ) ? __( 'Domain' ) : __( 'Path' );186 186 $sites_columns = array( 187 187 'cb' => '<input type="checkbox" />', 188 'blogname' => $blogname_columns,188 'blogname' => __( 'URL' ), 189 189 'lastupdated' => __( 'Last Updated' ), 190 190 'registered' => _x( 'Registered', 'site' ), 191 'users' => __( 'Users' ) 191 'users' => __( 'Users' ), 192 192 ); 193 193 194 if ( has_filter( 'wpmublogsaction' ) ) 194 if ( has_filter( 'wpmublogsaction' ) ) { 195 195 $sites_columns['plugins'] = __( 'Actions' ); 196 } 196 197 197 198 /** … … 262 263 echo "<tr{$class}>"; 263 264 264 $blogname = ( is_subdomain_install() ) ? str_replace( '.' . get_current_site()->domain, '', $blog['domain'] ) :$blog['path'];265 $blogname = $blog['domain'] . $blog['path']; 265 266 266 267 list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info(); … … 323 324 324 325 case 'users': 325 $blogusers = get_users( array( 'blog_id' => $blog['blog_id'], 'number' => 6) ); 326 if ( is_array( $blogusers ) ) { 327 $blogusers_warning = ''; 328 if ( count( $blogusers ) > 5 ) { 329 $blogusers = array_slice( $blogusers, 0, 5 ); 330 $blogusers_warning = __( 'Only showing first 5 users.' ) . ' <a href="' . esc_url( network_admin_url( 'site-users.php?id=' . $blog['blog_id'] ) ) . '">' . __( 'More' ) . '</a>'; 331 } 332 foreach ( $blogusers as $user_object ) { 333 echo '<a href="' . esc_url( network_admin_url( 'user-edit.php?user_id=' . $user_object->ID ) ) . '">' . esc_html( $user_object->user_login ) . '</a> '; 334 if ( 'list' != $mode ) 335 echo '( ' . $user_object->user_email . ' )'; 336 echo '<br />'; 337 } 338 if ( $blogusers_warning != '' ) 339 echo '<strong>' . $blogusers_warning . '</strong><br />'; 326 if ( ! $user_count = wp_cache_get( $blog['blog_id'] . '_user_count', 'blog-details' ) ) { 327 $blog_users = get_users( array( 'blog_id' => $blog['blog_id'], 'fields' => 'ID' ) ); 328 $user_count = count( $blog_users ); 329 unset( $blog_users ); 330 wp_cache_set( $blog['blog_id'] . '_user_count', $user_count, 'blog-details', 12 * HOUR_IN_SECONDS ); 340 331 } 332 333 printf( 334 '<a href="%s">%s</a>', 335 esc_url( network_admin_url( 'site-users.php?id=' . $blog['blog_id'] ) ), 336 number_format_i18n( $user_count ) 337 ); 341 338 break; 342 339
Note: See TracChangeset
for help on using the changeset viewer.