| 1 |
<?php |
| 2 |
/** |
| 3 |
* This template shows the Unfriend page. |
| 4 |
* |
| 5 |
* @version 1.0 |
| 6 |
* @package Friends |
| 7 |
*/ |
| 8 |
|
| 9 |
$friend_name = $args['friend']->display_name . ' (' . $args['friend']->user_login . ')'; |
| 10 |
$heading = sprintf( |
| 11 |
// translators: %s is a username. |
| 12 |
_x( 'Unfriend %s', 'heading', 'friends' ), |
| 13 |
$friend_name |
| 14 |
); |
| 15 |
|
| 16 |
$button_text = sprintf( |
| 17 |
// translators: %s is a username. |
| 18 |
_x( 'Delete %s', 'action', 'friends' ), |
| 19 |
$friend_name |
| 20 |
); |
| 21 |
if ( is_multisite() ) { |
| 22 |
$button_text = sprintf( |
| 23 |
// translators: %s is a username. |
| 24 |
_x( 'Remove %s', 'action', 'friends' ), |
| 25 |
$friend_name |
| 26 |
); |
| 27 |
} |
| 28 |
$numfeeds = count( $args['friend']->get_active_feeds() ); |
| 29 |
|
| 30 |
?> |
| 31 |
<div class="wrap"> |
| 32 |
<h3><?php echo esc_html( $heading ); ?></h3> |
| 33 |
<form method="post"> |
| 34 |
<?php wp_nonce_field( 'unfriend-' . $args['friend']->user_login ); ?> |
| 35 |
<h4 class="unfriend"> |
| 36 |
<?php |
| 37 |
echo get_avatar( $args['friend']->user_login, 24 ); |
| 38 |
echo ' '; |
| 39 |
echo esc_html( $friend_name ); |
| 40 |
?> |
| 41 |
</h4> |
| 42 |
<ul class="ul-disc"> |
| 43 |
<li> |
| 44 |
<a href="<?php echo esc_url( $args['friend']->get_local_friends_page_url() ); ?>"> |
| 45 |
<?php |
| 46 |
echo esc_html( |
| 47 |
sprintf( |
| 48 |
/* translators: %s: Number of posts. */ |
| 49 |
_n( '%s post', '%s posts', $args['friend_posts'] ), // phpcs:ignore WordPress.WP.I18n.MissingArgDomain |
| 50 |
number_format_i18n( $args['friend_posts'] ) |
| 51 |
) |
| 52 |
); |
| 53 |
?> |
| 54 |
</li> |
| 55 |
<li> |
| 56 |
<a href="<?php echo esc_url( self_admin_url( 'admin.php?page=edit-friend-feeds&user=' . $args['friend']->user_login ) ); ?>"> |
| 57 |
<?php |
| 58 |
echo esc_html( |
| 59 |
sprintf( |
| 60 |
/* translators: %s is the number of feeds */ |
| 61 |
_n( '%s feed', '%s feeds', $numfeeds, 'friends' ), |
| 62 |
number_format_i18n( $numfeeds ) |
| 63 |
) |
| 64 |
); |
| 65 |
?> |
| 66 |
</a> |
| 67 |
</li> |
| 68 |
</ul> |
| 69 |
<p class="description"> |
| 70 |
<?php |
| 71 |
esc_html_e( 'This will delete all cached posts, feeds, and other metadata for this user on this site.', 'friends' ); |
| 72 |
if ( ! $args['friend'] instanceof \Friends\Subscription ) { |
| 73 |
echo ' '; |
| 74 |
if ( is_multisite() ) { |
| 75 |
esc_html_e( 'Since this is a multisite install, the user will be removed from this site.', 'friends' ); |
| 76 |
} else { |
| 77 |
esc_html_e( 'Since this friend is a WordPress user, unfriending them means to delete the user.', 'friends' ); |
| 78 |
} |
| 79 |
} |
| 80 |
?> |
| 81 |
</p> |
| 82 |
|
| 83 |
<p class="submit"> |
| 84 |
<input type="submit" id="submit" class="button button-primary" value="<?php echo esc_html( $button_text ); ?>"> |
| 85 |
<a href="<?php echo esc_url( add_query_arg( 'user', $args['friend']->user_login, self_admin_url( 'admin.php?page=edit-friend' ) ) ); ?>" class="button button-secondary"><?php esc_html_e( 'Cancel', 'friends' ); ?></a> |
| 86 |
</p> |
| 87 |
|
| 88 |
</form> |
| 89 |
</div> |
| 90 |
|