404 | | printf( |
405 | | '<a href="%s">%s</a>', |
406 | | esc_url( network_admin_url( 'site-users.php?id=' . $blog['blog_id'] ) ), |
407 | | number_format_i18n( $user_count ) |
408 | | ); |
| 408 | if ( empty ( $user_count ) ) { |
| 409 | printf( __( 'There are no users in this site' ) ); |
| 410 | return; |
| 411 | } |
| 412 | |
| 413 | if ( 'excerpt' === $mode) { |
| 414 | |
| 415 | $blog_users = get_users( array( |
| 416 | 'blog_id' => $blog['blog_id'], |
| 417 | 'orderby' => 'registered', |
| 418 | 'fields' => array('ID', 'user_login'), |
| 419 | 'number' => 10, |
| 420 | )); |
| 421 | |
| 422 | foreach ( $blog_users as $key => $user ) |
| 423 | { |
| 424 | if ( 0 !== $key ) { |
| 425 | echo '</br>'; |
| 426 | } |
| 427 | |
| 428 | printf( |
| 429 | '<a href="%s">%s</a>', |
| 430 | esc_url( network_admin_url( 'user-edit.php?user_id=' . $user->ID ) ), |
| 431 | $user->user_login |
| 432 | ); |
| 433 | } |
| 434 | |
| 435 | |
| 436 | } else { |
| 437 | $blog_users = get_users( array( |
| 438 | 'blog_id' => $blog['blog_id'], |
| 439 | 'orderby' => 'registered', |
| 440 | 'fields' => array('ID', 'user_login'), |
| 441 | 'number' => 1, |
| 442 | )); |
| 443 | |
| 444 | printf( |
| 445 | '<a href="%s">%s</a>', |
| 446 | esc_url( network_admin_url( 'user-edit.php?user_id=' . $blog_users[0]->ID ) ), |
| 447 | $blog_users[0]->user_login |
| 448 | ); |
| 449 | |
| 450 | } |
| 451 | |
| 452 | if ( $user_count > 1 ) { |
| 453 | printf( '</br><a href="%s">%s</a>', |
| 454 | esc_url( network_admin_url( 'site-users.php?id=' . $blog['blog_id'] ) ), |
| 455 | sprintf( |
| 456 | _x( '+ %s more users', 'Number of users of a site of a network (in admin page : wp-admin/network/sites.php)' ), |
| 457 | number_format_i18n( $user_count - count( $blog_users ) ) |
| 458 | ) |
| 459 | ); |
| 460 | } |
| 461 | |
| 462 | unset( $blog_users ); |