diff --git src/bp-members/classes/class-bp-members-admin.php src/bp-members/classes/class-bp-members-admin.php
index 574952589..767bb07a7 100644
|
|
class BP_Members_Admin { |
3018 | 3018 | 'id' => $ids, |
3019 | 3019 | 'invite_sent' => 'all', |
3020 | 3020 | 'accepted' => 'all', |
3021 | | 'fields' => 'ids', |
3022 | 3021 | ); |
3023 | | $invite_ids = bp_members_invitations_get_invites( $args ); |
| 3022 | $invites = bp_members_invitations_get_invites( $args ); |
| 3023 | $invite_ids = wp_list_pluck( $invites, 'id' ); |
3024 | 3024 | |
3025 | 3025 | $header_text = __( 'Delete Invitations', 'buddypress' ); |
3026 | | if ( 1 == count( $invite_ids ) ) { |
| 3026 | if ( 0 === count( $invite_ids ) ) { |
| 3027 | $helper_text = __( 'No invites were found, nothing to delete!', 'buddypress' ); |
| 3028 | |
| 3029 | /** |
| 3030 | * @todo You should probably use `_n()` otherwise. |
| 3031 | */ |
| 3032 | } elseif ( 1 === count( $invite_ids ) ) { |
3027 | 3033 | $helper_text = __( 'You are about to delete the following invitation:', 'buddypress' ); |
3028 | 3034 | } else { |
3029 | 3035 | $helper_text = __( 'You are about to delete the following invitations:', 'buddypress' ); |
… |
… |
class BP_Members_Admin { |
3044 | 3050 | $invite_ids = wp_list_pluck( $invites, 'id' ); |
3045 | 3051 | |
3046 | 3052 | $header_text = __( 'Resend Invitation Emails', 'buddypress' ); |
3047 | | if ( 1 == count( $invite_ids ) ) { |
| 3053 | if ( 0 === count( $invite_ids ) ) { |
| 3054 | $helper_text = __( 'No pending invites were found, nothing to resend!', 'buddypress' ); |
| 3055 | |
| 3056 | /** |
| 3057 | * @todo You should probably use `_n()` otherwise. |
| 3058 | */ |
| 3059 | } elseif ( 1 === count( $invite_ids ) ) { |
3048 | 3060 | $helper_text = __( 'You are about to resend an invitation email to the following address:', 'buddypress' ); |
3049 | 3061 | } else { |
3050 | 3062 | $helper_text = __( 'You are about to resend an invitation email to the following addresses:', 'buddypress' ); |
… |
… |
class BP_Members_Admin { |
3084 | 3096 | |
3085 | 3097 | <p><?php echo esc_html( $helper_text ); ?></p> |
3086 | 3098 | |
3087 | | <ol class="bp-invitations-list"> |
3088 | | <?php foreach ( $invites as $invite ) : |
3089 | | if ( $invite->invite_sent ) { |
3090 | | $last_notified = mysql2date( 'Y/m/d g:i:s a', $invite->date_modified ); |
3091 | | } else { |
3092 | | $last_notified = __( 'Not yet notified', 'buddypress'); |
3093 | | } |
3094 | | ?> |
| 3099 | <?php if ( $invites ) : ?> |
3095 | 3100 | |
3096 | | <li> |
3097 | | <strong><?php echo esc_html( $invite->invitee_email ) ?></strong> |
| 3101 | <ol class="bp-invitations-list"> |
| 3102 | <?php foreach ( $invites as $invite ) : |
| 3103 | if ( $invite->invite_sent ) { |
| 3104 | $last_notified = mysql2date( 'Y/m/d g:i:s a', $invite->date_modified ); |
| 3105 | } else { |
| 3106 | $last_notified = __( 'Not yet notified', 'buddypress'); |
| 3107 | } |
| 3108 | ?> |
3098 | 3109 | |
3099 | | <?php if ( 'resend' == $action ) : ?> |
| 3110 | <li> |
| 3111 | <strong><?php echo esc_html( $invite->invitee_email ) ?></strong> |
3100 | 3112 | |
3101 | | <p class="description"> |
3102 | | <?php |
3103 | | /* translators: %s: notification date */ |
3104 | | printf( esc_html__( 'Last notified: %s', 'buddypress'), $last_notified ); |
3105 | | ?> |
3106 | | </p> |
| 3113 | <?php if ( 'resend' == $action ) : ?> |
3107 | 3114 | |
3108 | | <?php endif; ?> |
| 3115 | <p class="description"> |
| 3116 | <?php |
| 3117 | /* translators: %s: notification date */ |
| 3118 | printf( esc_html__( 'Last notified: %s', 'buddypress'), $last_notified ); |
| 3119 | ?> |
| 3120 | </p> |
3109 | 3121 | |
3110 | | </li> |
| 3122 | <?php endif; ?> |
3111 | 3123 | |
3112 | | <?php endforeach; ?> |
3113 | | </ol> |
| 3124 | </li> |
| 3125 | |
| 3126 | <?php endforeach; ?> |
| 3127 | </ol> |
| 3128 | |
| 3129 | <?php endif ; ?> |
3114 | 3130 | |
3115 | 3131 | <?php if ( 'delete' === $action ) : ?> |
3116 | 3132 | |
… |
… |
class BP_Members_Admin { |
3118 | 3134 | |
3119 | 3135 | <?php endif ; ?> |
3120 | 3136 | |
3121 | | <a class="button-primary" href="<?php echo esc_url( $action_url ); ?>"><?php esc_html_e( 'Confirm', 'buddypress' ); ?></a> |
| 3137 | <a class="button-primary" href="<?php echo esc_url( $action_url ); ?>" <?php disabled( ! $invites ); ?>><?php esc_html_e( 'Confirm', 'buddypress' ); ?></a> |
3122 | 3138 | <a class="button" href="<?php echo esc_url( $cancel_url ); ?>"><?php esc_html_e( 'Cancel', 'buddypress' ) ?></a> |
3123 | 3139 | </div> |
3124 | 3140 | |