Changeset 12930
- Timestamp:
- 04/29/2021 08:31:02 AM (3 years ago)
- Location:
- trunk/src
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/admin/bp-core-admin-optouts.php
r12911 r12930 328 328 if ( $usersearch ) { 329 329 $num_results = (int) $bp_optouts_list_table->total_items; 330 printf( '<p><span class="subtitle">' . esc_html( _n( 'Opt-out with an email address matching “%s”', 'Opt-outs with an email address matching “%s”', $num_results, 'buddypress' ) ) . '</span></p>', esc_html( $usersearch ) ); 330 printf( 331 '<p><span class="subtitle">%s</span></p>', 332 sprintf( 333 esc_html( 334 /* translators: %s: the searched email. */ 335 _n( 'Opt-out with an email address matching “%s”', 'Opt-outs with an email address matching “%s”', $num_results, 'buddypress' ) 336 ), 337 esc_html( $usersearch ) 338 ) 339 ); 331 340 } 332 341 ?> -
trunk/src/bp-groups/bp-groups-template.php
r12801 r12930 6034 6034 $message = __( 'Viewing 1 invitation', 'buddypress' ); 6035 6035 } else { 6036 /* translators: 1: group invite from number. 2: group invite to number. 3: total group invites. */6037 $message = sprintf( _n ( 'Viewing %1$s - %2$s of %3$s invitation', 'Viewing %1$s - %2$s of %3$s invitations', $invites_template->total_invite_count, 'buddypress' ), $from_num, $to_num, $total );6036 /* translators: 1: Invitations from number. 2: Invitations to number. 3: Total invitations. */ 6037 $message = sprintf( _nx( 'Viewing %1$s - %2$s of %3$s invitation', 'Viewing %1$s - %2$s of %3$s invitations', $invites_template->total_invite_count, 'Group invites pagination', 'buddypress' ), $from_num, $to_num, $total ); 6038 6038 } 6039 6039 -
trunk/src/bp-members/bp-members-filters.php
r12923 r12930 209 209 return $message; 210 210 } 211 211 212 $invite = bp_get_members_invitation_from_request(); 212 213 if ( ! $invite->id || ! $invite->invitee_email ) { … … 220 221 if ( $maybe_user ) { 221 222 $message = sprintf( 222 esc_html__( 'Welcome! You are already a member of this site. Please %1$s to continue. ', 'buddypress' ), 223 sprintf( '<a href="%1$s">%2$s</a>', esc_url( wp_login_url( bp_get_root_domain() ) ), esc_html__( 'log in', 'buddypress' ) ) 223 /* translators: %s: The log in link `<a href="login_url">log in</a>` */ 224 esc_html__( 'Welcome! You are already a member of this site. Please %s to continue.', 'buddypress' ), 225 sprintf( 226 '<a href="%1$s">%2$s</a>', 227 esc_url( wp_login_url( bp_get_root_domain() ) ), 228 esc_html__( 'log in', 'buddypress' ) 229 ) 224 230 ); 231 225 232 // This user can register! 226 233 } else { … … 231 238 'invite_sent' => 'sent', 232 239 ); 233 $all_invites = bp_members_invitations_get_invites( $all_args ); 234 $inviters = array(); 240 241 $all_invites = bp_members_invitations_get_invites( $args ); 242 $inviters = array(); 243 235 244 foreach ( $all_invites as $inv ) { 236 245 $inviters[] = bp_core_get_user_displayname( $inv->inviter_id ); … … 238 247 239 248 if ( ! empty( $inviters ) ) { 240 $message = sprintf( _n( 'Welcome! You’ve been invited to join the site by the following user: %s. ', 'Welcome! You’ve been invited to join the site by the following users: %s. ', count( $inviters ), 'buddypress' ), implode( ', ', $inviters ) ); 249 $message = sprintf( 250 /* translators: %s: The comma separated list of inviters display names */ 251 _n( 'Welcome! You’ve been invited to join the site by the following user: %s.', 'Welcome! You’ve been invited to join the site by the following users: %s.', count( $inviters ), 'buddypress' ), 252 implode( ', ', $inviters ) 253 ); 241 254 } else { 242 255 $message = __( 'Welcome! You’ve been invited to join the site. ', 'buddypress' ); … … 270 283 271 284 if ( ! $maybe_user ) { 272 $message = __( 'Member registration is allowed by invitation only.', 'buddypress' ); 285 $message_parts = array( esc_html__( 'Member registration is allowed by invitation only.', 'buddypress' ) ); 286 273 287 // Is the user trying to accept an invitation but something is wrong? 274 288 if ( ! empty( $_GET['inv'] ) ) { 275 $message .= __( 'It looks like there is a problem with your invitation. Please try again.', 'buddypress' );289 $message_parts[] = esc_html__( 'It looks like there is a problem with your invitation. Please try again.', 'buddypress' ); 276 290 } 291 292 $message = implode( ' ', $message_parts ); 277 293 } else if ( 'nouveau' === bp_get_theme_package_id() ) { 278 294 $message = sprintf( 295 /* translators: 1: The log in link `<a href="login_url">log in</a>`. 2: The lost password link `<a href="lost_password_url">log in</a>` */ 279 296 esc_html__( 'Welcome! You are already a member of this site. Please %1$s to continue. If you have forgotten your password, you can %2$s.', 'buddypress' ), 280 sprintf( '<a href="%1$s">%2$s</a>', esc_url( wp_login_url( bp_get_root_domain() ) ), esc_html__( 'log in', 'buddypress' ) ), 281 sprintf( '<a href="%1$s">%2$s</a>', esc_url( wp_lostpassword_url( bp_get_root_domain() ) ), esc_html__( 'reset it', 'buddypress' ) ) 297 sprintf( 298 '<a href="%1$s">%2$s</a>', 299 esc_url( wp_login_url( bp_get_root_domain() ) ), 300 esc_html__( 'log in', 'buddypress' ) 301 ), 302 sprintf( 303 '<a href="%1$s">%2$s</a>', 304 esc_url( wp_lostpassword_url( bp_get_root_domain() ) ), 305 esc_html__( 'reset it', 'buddypress' ) 306 ) 282 307 ); 283 308 } 284 309 } 310 285 311 return $message; 286 312 } -
trunk/src/bp-members/bp-members-functions.php
r12918 r12930 3402 3402 * @return bool True on success, false on failure. 3403 3403 */ 3404 function bp_members_invitations_invite_user( $args ) { 3405 $r = bp_parse_args( $args, array( 3406 'invitee_email' => '', 3407 'network_id' => get_current_network_id(), 3408 'inviter_id' => bp_loggedin_user_id(), 3409 'date_modified' => bp_core_current_time(), 3410 'content' => '', 3411 'send_invite' => 0 3412 ), 'community_invite_user' ); 3404 function bp_members_invitations_invite_user( $args = array() ) { 3405 $r = bp_parse_args( 3406 $args, 3407 array( 3408 'invitee_email' => '', 3409 'network_id' => get_current_network_id(), 3410 'inviter_id' => bp_loggedin_user_id(), 3411 'date_modified' => bp_core_current_time(), 3412 'content' => '', 3413 'send_invite' => 0 3414 ), 3415 'community_invite_user' 3416 ); 3413 3417 3414 3418 $inv_args = array( … … 3537 3541 * @return bool True if all were deleted. 3538 3542 */ 3539 function bp_members_invitations_delete_invites( $args ) { 3540 $r = bp_parse_args( $args, array( 3541 'id' => false, 3542 'invitee_email' => '', 3543 'network_id' => get_current_network_id(), 3544 'inviter_id' => null, 3545 'accepted' => null, 3546 'invite_sent' => null 3547 ), 'members_invitations_delete_invites' ); 3543 function bp_members_invitations_delete_invites( $args = array() ) { 3544 $r = bp_parse_args( 3545 $args, 3546 array( 3547 'id' => false, 3548 'invitee_email' => '', 3549 'network_id' => get_current_network_id(), 3550 'inviter_id' => null, 3551 'accepted' => null, 3552 'invite_sent' => null 3553 ), 3554 'members_invitations_delete_invites' 3555 ); 3548 3556 3549 3557 $inv_args = array( … … 3557 3565 3558 3566 // Find the invitation(s). 3559 $invites 3560 $total_count 3567 $invites = bp_members_invitations_get_invites( $inv_args ); 3568 $total_count = count( $invites ); 3561 3569 3562 3570 // Loop through, deleting each invitation. … … 3625 3633 // Check to make sure the passed hash matches a calculated hash. 3626 3634 $maybe_invite = $invites_class->get_by_id( absint( $_GET['inv'] ) ); 3627 $hash = bp_members_invitations_get_hash( $maybe_invite ); 3635 $hash = bp_members_invitations_get_hash( $maybe_invite ); 3636 3628 3637 if ( $_GET['ih'] === $hash ) { 3629 3638 $invite = $maybe_invite; -
trunk/src/bp-members/bp-members-template.php
r12919 r12930 3050 3050 $pag = __( 'Viewing 1 invitation', 'buddypress' ); 3051 3051 } else { 3052 /* translators: 1: notification from number. 2: notification to number. 3: total notifications. */3053 $pag = sprintf( _n ( 'Viewing %1$s - %2$s of %3$s invitation', 'Viewing %1$s - %2$s of %3$s invitations', $query_loop->total_invitation_count, 'buddypress' ), $from_num, $to_num, $total );3052 /* translators: 1: Invitations from number. 2: Invitations to number. 3: Total invitations. */ 3053 $pag = sprintf( _nx( 'Viewing %1$s - %2$s of %3$s invitation', 'Viewing %1$s - %2$s of %3$s invitations', $query_loop->total_invitation_count, 'Community invites pagination', 'buddypress' ), $from_num, $to_num, $total ); 3054 3054 } 3055 3055 -
trunk/src/bp-members/classes/class-bp-members-admin.php
r12927 r12930 3005 3005 ?> 3006 3006 3007 <hr class="wp-header-end">3008 3009 3007 <?php // Display each invitation on its own row. ?> 3010 3008 <?php $bp_members_invitations_list_table->views(); ?> -
trunk/src/bp-members/classes/class-bp-members-invitation-manager.php
r12917 r12930 45 45 // Coming soon to a BuddyPress near you! 46 46 return true; 47 47 48 // Notify the invitee of the invitation. 48 49 } else { -
trunk/src/bp-members/classes/class-bp-members-invitations-list-table.php
r12927 r12930 67 67 68 68 $args = array( 69 'invite_sent' 70 'accepted' 71 'search_terms' 72 'order_by' 73 'sort_order' 74 'page' 75 'per_page' 69 'invite_sent' => 'all', 70 'accepted' => 'all', 71 'search_terms' => $search, 72 'order_by' => 'date_modified', 73 'sort_order' => 'DESC', 74 'page' => $paged, 75 'per_page' => $per_page, 76 76 ); 77 77 … … 123 123 ?> 124 124 125 <h2 class="screen-reader-text"><?php 125 <h2 class="screen-reader-text"> 126 <?php 126 127 /* translators: accessibility text */ 127 128 esc_html_e( 'Filter invitations list', 'buddypress' ); 128 ?></h2> 129 ?> 130 </h2> 129 131 <ul class="subsubsub"> 130 132 <li class="all"> … … 199 201 * @param array $value Array of columns to display. 200 202 */ 201 return apply_filters( 'bp_members_invitations_list_columns', array( 202 'cb' => '<input type="checkbox" />', 203 'invitee_email' => __( 'Invitee', 'buddypress' ), 204 'username' => __( 'Inviter', 'buddypress' ), 205 'inviter_registered_date' => __( 'Inviter Registered', 'buddypress' ), 206 'invitation_date_modified' => __( 'Date Modified', 'buddypress' ), 207 'invitation_sent' => __( 'Email Sent', 'buddypress' ), 208 'invitation_accepted' => __( 'Accepted', 'buddypress' ) 209 ) ); 203 return apply_filters( 204 'bp_members_invitations_list_columns', 205 array( 206 'cb' => '<input type="checkbox" />', 207 'invitee_email' => __( 'Invitee', 'buddypress' ), 208 'username' => __( 'Inviter', 'buddypress' ), 209 'inviter_registered_date' => __( 'Inviter Registered', 'buddypress' ), 210 'invitation_date_modified' => __( 'Date Modified', 'buddypress' ), 211 'invitation_sent' => __( 'Email Sent', 'buddypress' ), 212 'invitation_accepted' => __( 'Accepted', 'buddypress' ) 213 ) 214 ); 210 215 } 211 216 … … 239 244 esc_html_e( 'No invitations found.', 'buddypress' ); 240 245 } else { 241 $link = sprintf( '<a href="%1$s">%2$s</a>', esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-settings' ), 'admin.php' ) ) ), esc_html__( 'Edit settings', 'buddypress' ) ); 246 $link = sprintf( 247 '<a href="%1$s">%2$s</a>', 248 esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-settings' ), 'admin.php' ) ) ), 249 esc_html__( 'Edit settings', 'buddypress' ) 250 ); 242 251 243 252 /* translators: %s: url to site settings */ … … 302 311 */ 303 312 public function column_cb( $invite = null ) { 304 ?> 305 <label class="screen-reader-text" for="invitation_<?php echo intval( $invite->id ); ?>"><?php 306 /* translators: accessibility text */ 307 printf( esc_html__( 'Select invitation: %s', 'buddypress' ), $invite->id ); 308 ?></label> 313 ?> 314 <label class="screen-reader-text" for="invitation_<?php echo intval( $invite->id ); ?>"> 315 <?php 316 /* translators: accessibility text */ 317 printf( esc_html__( 'Select invitation: %s', 'buddypress' ), $invite->id ); 318 ?> 319 </label> 309 320 <input type="checkbox" id="invitation_<?php echo intval( $invite->id ) ?>" name="invite_ids[]" value="<?php echo esc_attr( $invite->id ) ?>" /> 310 321 <?php -
trunk/src/bp-members/classes/class-bp-members-invitations-template.php
r12919 r12930 163 163 164 164 // Parse arguments. 165 $r = wp_parse_args( $args, array( 166 'id' => false, 167 'user_id' => false, 168 'inviter_id' => false, 169 'invitee_email' => false, 170 'item_id' => false, 171 'type' => 'invite', 172 'invite_sent' => 'all', 173 'accepted' => 'all', 174 'search_terms' => '', 175 'order_by' => 'date_modified', 176 'sort_order' => 'DESC', 177 'page' => 1, 178 'per_page' => 25, 179 'fields' => 'all', 180 'page_arg' => 'ipage', 181 ) ); 165 $r = wp_parse_args( 166 $args, 167 array( 168 'id' => false, 169 'user_id' => false, 170 'inviter_id' => false, 171 'invitee_email' => false, 172 'item_id' => false, 173 'type' => 'invite', 174 'invite_sent' => 'all', 175 'accepted' => 'all', 176 'search_terms' => '', 177 'order_by' => 'date_modified', 178 'sort_order' => 'DESC', 179 'page' => 1, 180 'per_page' => 25, 181 'fields' => 'all', 182 'page_arg' => 'ipage', 183 ) 184 ); 182 185 183 186 // Sort order direction. … … 191 194 // Setup variables. 192 195 $this->pag_arg = sanitize_key( $r['page_arg'] ); 193 $this->pag_page = bp_sanitize_pagination_arg( $this->pag_arg, $r['page'] 194 $this->pag_num = bp_sanitize_pagination_arg( 'num', 196 $this->pag_page = bp_sanitize_pagination_arg( $this->pag_arg, $r['page'] ); 197 $this->pag_num = bp_sanitize_pagination_arg( 'num', $r['per_page'] ); 195 198 $this->user_id = $r['user_id']; 196 199 $this->search_terms = $r['search_terms']; … … 198 201 $this->sort_order = $r['sort_order']; 199 202 $this->query_vars = array( 200 'id' 201 'user_id' 202 'inviter_id' 203 'invitee_email' 204 'item_id' 205 'type' 206 'invite_sent' 207 'accepted' 208 'search_terms' 209 'order_by' 210 'sort_order' 211 'page' 212 'per_page' 203 'id' => $r['id'], 204 'user_id' => $r['user_id'], 205 'inviter_id' => $r['inviter_id'], 206 'invitee_email' => $r['invitee_email'], 207 'item_id' => $r['item_id'], 208 'type' => $r['type'], 209 'invite_sent' => $r['invite_sent'], 210 'accepted' => $r['accepted'], 211 'search_terms' => $this->search_terms, 212 'order_by' => $this->order_by, 213 'sort_order' => $this->sort_order, 214 'page' => $this->pag_page, 215 'per_page' => $this->pag_num, 213 216 ); 214 217 … … 225 228 ); 226 229 227 $this->pag_links = paginate_links( array( 228 'base' => add_query_arg( $this->pag_arg, '%#%' ), 229 'format' => '', 230 'total' => ceil( (int) $this->total_invitation_count / (int) $this->pag_num ), 231 'current' => $this->pag_page, 232 'prev_text' => _x( '←', 'Network invitation pagination previous text', 'buddypress' ), 233 'next_text' => _x( '→', 'Network invitation pagination next text', 'buddypress' ), 234 'mid_size' => 1, 235 'add_args' => $add_args, 236 ) ); 230 $this->pag_links = paginate_links( 231 array( 232 'base' => add_query_arg( $this->pag_arg, '%#%' ), 233 'format' => '', 234 'total' => ceil( (int) $this->total_invitation_count / (int) $this->pag_num ), 235 'current' => $this->pag_page, 236 'prev_text' => _x( '←', 'Network invitation pagination previous text', 'buddypress' ), 237 'next_text' => _x( '→', 'Network invitation pagination next text', 'buddypress' ), 238 'mid_size' => 1, 239 'add_args' => $add_args, 240 ) 241 ); 237 242 } 238 243 } -
trunk/src/bp-templates/bp-legacy/buddypress-functions.php
r12922 r12930 2021 2021 * 2022 2022 * @since 8.0.0 2023 *2024 * @return string $message The message text.2025 2023 */ 2026 2024 function bp_members_invitations_add_legacy_welcome_message() { 2027 2025 $message = bp_members_invitations_get_registration_welcome_message(); 2026 2028 2027 if ( $message ) { 2029 echo apply_filters( 'wpautop', $message ); 2028 // Surround the message with `<p>` tags. 2029 echo wpautop( $message ); 2030 2030 } 2031 2031 } … … 2038 2038 * 2039 2039 * @since 8.0.0 2040 *2041 * @return string $message The message text.2042 2040 */ 2043 2041 function bp_members_invitations_add_legacy_registration_disabled_message() { 2044 2042 $message = bp_members_invitations_get_modified_registration_disabled_message(); 2043 2045 2044 if ( $message ) { 2046 echo apply_filters( 'wpautop', $message ); 2045 // Surround the message with `<p>` tags. 2046 echo wpautop( $message ); 2047 2047 } 2048 2048 } -
trunk/src/bp-templates/bp-nouveau/buddypress-functions.php
r12921 r12930 696 696 $messages['registration-disabled']['message'] = $disallowed_message; 697 697 } 698 698 699 // Add information about invitations to the welcome block. 699 700 $welcome_message = bp_members_invitations_get_registration_welcome_message(); 700 701 if ( $welcome_message ) { 701 $messages['request-details']['message'] = $welcome_message . $messages['request-details']['message']; 702 } 702 $messages['request-details']['message'] = $welcome_message . ' ' . $messages['request-details']['message']; 703 } 704 703 705 return $messages; 704 706 }
Note: See TracChangeset
for help on using the changeset viewer.