| 1 |
<?php |
| 2 |
/** |
| 3 |
* This template shows the latest friends section. |
| 4 |
* |
| 5 |
* @version 1.0 |
| 6 |
* @package Friends |
| 7 |
*/ |
| 8 |
|
| 9 |
if ( empty( $args['friend_requests'] ) ) { |
| 10 |
return; |
| 11 |
} |
| 12 |
|
| 13 |
?> |
| 14 |
<h3><?php esc_html_e( 'Your Latest Friends', 'friends' ); ?></h3> |
| 15 |
<table class="wp-list-table widefat fixed striped" style="margin-top: 2em; margin-right: 1em"> |
| 16 |
<thead> |
| 17 |
<tr> |
| 18 |
<th style="width: 18em" class="column-primary column-site"><?php esc_html_e( 'Site', 'friends' ); ?></th> |
| 19 |
<th style="width: 15em" class="column-date"><?php /* phpcs:ignore WordPress.WP.I18n.MissingArgDomain */ esc_html_e( 'Date' ); ?></th> |
| 20 |
<th class="column-status"><?php esc_html_e( 'Status', 'friends' ); ?></th> |
| 21 |
</tr> |
| 22 |
</thead> |
| 23 |
<tbody> |
| 24 |
<?php foreach ( $args['friend_requests'] as $friend_user ) : ?> |
| 25 |
<tr> |
| 26 |
<td class="site column-site column-primary" data-colname="<?php esc_attr_e( 'Site', 'friends' ); ?>"> |
| 27 |
<a href="<?php echo esc_url( Friends\Admin::get_edit_friend_link( $friend_user->ID ) ); ?>"><?php echo esc_html( $friend_user->display_name ); ?></a> |
| 28 |
<button type="button" class="toggle-row"><span class="screen-reader-text"><?php /* phpcs:ignore WordPress.WP.I18n.MissingArgDomain */ esc_html_e( 'Show more details' ); ?></span></button> |
| 29 |
</td> |
| 30 |
<td class="date column-date" data-colname="<?php /* phpcs:ignore WordPress.WP.I18n.MissingArgDomain */ esc_attr_e( 'Date' ); ?>"><?php echo esc_html( date_i18n( __( 'F j, Y g:i a' ), strtotime( $friend_user->user_registered ) ) ); ?></td> |
| 31 |
<td class="status column-status" data-colname="<?php esc_attr_e( 'Status', 'friends' ); ?>"><?php echo esc_html( $friend_user->get_role_name() ); ?></td> |
| 32 |
</tr> |
| 33 |
<?php endforeach; ?> |
| 34 |
</tbody> |
| 35 |
</table> |
| 36 |
</div> |
| 37 |
|