Ticket #32434: 32434.patch
File 32434.patch, 2.7 KB (added by , 10 years ago) |
---|
-
src/wp-admin/includes/class-wp-ms-sites-list-table.php
111 111 } elseif ( $order_by == 'lastupdated' ) { 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 '; 120 121 } else { … … 182 183 * @return array 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' )192 191 ); 193 192 194 if ( has_filter( 'wpmublogsaction' ) ) 193 if ( has_filter( 'wpmublogsaction' ) ) { 195 194 $sites_columns['plugins'] = __( 'Actions' ); 195 } 196 196 197 197 /** 198 198 * Filter the displayed site columns in Sites list table. … … 261 261 } 262 262 echo "<tr{$class}>"; 263 263 264 $blogname = ( is_subdomain_install() ) ? str_replace( '.' . get_current_site()->domain, '', $blog['domain'] ) :$blog['path'];264 $blogname = $blog['domain'] . $blog['path']; 265 265 266 266 list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info(); 267 267 … … 321 321 } 322 322 break; 323 323 324 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 />';340 }341 break;342 343 324 case 'plugins': 344 325 if ( has_filter( 'wpmublogsaction' ) ) { 345 326 /**