Changeset 13169
- Timestamp:
- 12/10/2021 04:14:51 PM (22 months ago)
- Location:
- trunk/src
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/admin/js/hello.js
r13140 r13169 20 20 21 21 window.tb_show( 'BuddyPress', '#TB_inline?inlineId=bp-hello-container' ); 22 23 $( '#TB_window' ).attr( { 24 'role': 'dialog', 25 'aria-label': bpHelloStrings.modalLabel 26 } ) 27 .addClass( 'plugin-details-modal' ) 28 .removeClass( 'thickbox-loading' ); 29 30 $( '#TB_ajaxContent' ).prop( 'style', 'height: 100%; width: auto; padding: 0; border: none;' ); 31 32 var tabbables = $( ':tabbable', '#TB_ajaxContent' ), lastTabbable = tabbables.last(); 33 34 // Move the focus to the Modal's close button once the last Hello link was tabbed out. 35 $( '#TB_window' ).on( 'keydown', function( event ) { 36 if ( 9 === event.keyCode && ! event.shiftKey && $( lastTabbable ).prop( 'classList' ).value === $( event.target ).prop( 'classList' ).value ) { 37 event.preventDefault(); 38 39 $( '#TB_closeWindowButton' ).focus(); 40 } 41 42 if ( 9 === event.keyCode && event.shiftKey && 'TB_closeWindowButton' === $( event.target ).prop( 'id' ) ) { 43 event.preventDefault(); 44 45 $( lastTabbable ).focus(); 46 } 47 } ); 22 window.bpAdjustThickbox( bpHelloStrings.modalLabel ); 48 23 }; 49 24 -
trunk/src/bp-core/classes/class-bp-admin.php
r13166 r13169 1296 1296 ), 1297 1297 1298 // 10.0 1299 'bp-thickbox' => array( 1300 'file' => "{$url}bp-thickbox{$min}.js", 1301 'dependencies' => array( 'thickbox' ), 1302 'footer' => true, 1303 ), 1304 1298 1305 // 3.0 1299 1306 'bp-hello-js' => array( 1300 1307 'file' => "{$url}hello{$min}.js", 1301 'dependencies' => array( ' thickbox', 'wp-api-request' ),1308 'dependencies' => array( 'bp-thickbox', 'wp-api-request' ), 1302 1309 'footer' => true, 1303 1310 ), -
trunk/src/bp-members/bp-members-admin.php
r13131 r13169 113 113 } 114 114 add_filter( 'term_updated_messages', 'bp_members_type_admin_updated_messages' ); 115 116 /** 117 * Formats xprofile field data about a signup/membership request for display. 118 * 119 * Operates recursively on arrays, which are then imploded with commas. 120 * 121 * @since 10.0.0 122 * 123 * @param string|array $value Field value. 124 */ 125 function bp_members_admin_format_xprofile_field_for_display( $value ) { 126 if ( is_array( $value ) ) { 127 $value = array_map( 'bp_signup_format_xprofile_field_for_display', $value ); 128 $value = implode( ', ', $value ); 129 } else { 130 $value = stripslashes( $value ); 131 $value = esc_html( $value ); 132 } 133 134 return $value; 135 } 136 137 /** 138 * Outputs Informations about a signup/membership request into a modal inside the Signups Admin Screen. 139 * 140 * @since 10.0.0 141 * 142 * @param array $signup_field_labels The Signup field labels. 143 * @param object|null $signup_object The signup data object. 144 */ 145 function bp_members_admin_preview_signup_profile_info( $signup_field_labels = array(), $signup_object = null ) { 146 147 ?> 148 <div id="signup-info-modal-<?php echo $signup_object->id; ?>" style="display:none;"> 149 <h1><?php printf( '%1$s (%2$s)', esc_html( $signup_object->user_name ), esc_html( $signup_object->user_email ) ); ?></h1> 150 151 <?php if ( bp_is_active( 'xprofile' ) && isset( $signup_object->meta ) && $signup_field_labels ) : 152 // Init ids. 153 $profile_field_ids = array(); 154 155 // Get all xprofile field IDs except field 1. 156 if ( ! empty( $signup_object->meta['profile_field_ids'] ) ) { 157 $profile_field_ids = array_flip( explode( ',', $signup_object->meta['profile_field_ids'] ) ); 158 unset( $profile_field_ids[1] ); 159 } 160 ?> 161 <h2><?php esc_html_e( 'Extended Profile Information', 'buddypress' ); ?></h2> 162 163 <table class="signup-profile-data-drawer wp-list-table widefat fixed striped"> 164 <?php if ( 1 <= count( $profile_field_ids ) ): foreach ( array_keys( $profile_field_ids ) as $profile_field_id ) : 165 $field_value = isset( $signup_object->meta[ "field_{$profile_field_id}" ] ) ? $signup_object->meta[ "field_{$profile_field_id}" ] : ''; ?> 166 <tr> 167 <td class="column-fields"><?php echo esc_html( $signup_field_labels[ $profile_field_id ] ); ?></td> 168 <td><?php echo bp_members_admin_format_xprofile_field_for_display( $field_value ); ?></td> 169 </tr> 170 <?php endforeach; else: ?> 171 <tr> 172 <td><?php esc_html_e( 'There is no additional information to display.', 'buddypress' ); ?></td> 173 </tr> 174 <?php endif; ?> 175 </table> 176 <?php endif; ?> 177 178 <?php if ( bp_members_site_requests_enabled() ) : ?> 179 <h2><?php esc_html_e( 'Site Request Information', 'buddypress' ); ?></h2> 180 <table class="signup-profile-data-drawer wp-list-table widefat fixed striped"> 181 <?php if ( ! empty( $signup_object->domain ) || ! empty( $signup_object->path ) ) : ?> 182 <tr> 183 <td class="column-fields"><?php esc_html_e( 'Site Title', 'buddypress' ); ?></td> 184 <td><?php echo esc_html( $signup_object->title ); ?></td> 185 </tr> 186 <tr> 187 <td class="column-fields"><?php esc_html_e( 'Domain', 'buddypress' ); ?></td> 188 <td><?php echo esc_html( $signup_object->domain ); ?></td> 189 </tr> 190 <tr> 191 <td class="column-fields"><?php esc_html_e( 'Path', 'buddypress' ); ?></td> 192 <td><?php echo esc_html( $signup_object->path ); ?></td> 193 </tr> 194 <?php else : ?> 195 <tr> 196 <td><?php esc_html_e( 'This user has not requested a blog.', 'buddypress' ); ?></td> 197 </tr> 198 <?php endif; ?> 199 </table> 200 <?php endif; ?> 201 </div> 202 <?php 203 } -
trunk/src/bp-members/bp-members-membership-requests.php
r13168 r13169 259 259 add_action( 'bp_core_signup_after_delete', 'bp_members_membership_requests_delete_notifications_on_change' ); 260 260 261 /** 262 * Administration: Change certain behavior and labels 263 * on the WP Admin > Users > Manage Signups screen. 264 *********************************************************************/ 265 266 /** 267 * Filter the actions available on the signups list table. 268 * 269 * @since 10.0.0 270 * 271 * @param array $actions Array of actions and corresponding links. 272 * @param object $signup_object The signup data object. 273 */ 274 function bp_members_membership_requests_filter_signup_row_actions( $actions, $signup_object ) { 275 276 // Rename the "email" resend option when membership requests are active. 277 $email_link = add_query_arg( 278 array( 279 'page' => 'bp-signups', 280 'signup_id' => $signup_object->id, 281 'action' => 'resend', 282 ), 283 bp_get_admin_url( 'users.php' ) 284 ); 285 286 $resend_label = ( 0 === $signup_object->count_sent ) ? __( 'Approve Request', 'buddypress' ) : __( 'Resend Approval', 'buddypress' ); 287 288 $actions['resend'] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $email_link ), esc_html( $resend_label ) ); 289 290 // Add a link to view profile info when membership requests and xprofile are active. 291 if ( bp_is_active( 'xprofile' ) || bp_members_site_requests_enabled() ) { 292 $profile_link = add_query_arg( 293 array( 294 'page' => 'bp-signups#TB_inline', 295 'inlineId' => 'signup-info-modal-' . $signup_object->id, 296 ), 297 bp_get_admin_url( 'users.php' ) 298 ); 299 300 $actions['profile'] = sprintf( '<a href="%1$s" class="bp-thickbox">%2$s</a>', esc_url( $profile_link ), esc_html__( 'Profile Info', 'buddypress' ) ); 301 } 302 303 return $actions; 304 } 305 add_filter( 'bp_members_ms_signup_row_actions', 'bp_members_membership_requests_filter_signup_row_actions', 10, 2 ); 306 307 /** 308 * Filter the bulk actions available on the signups list table. 309 * 310 * @since 10.0.0 311 * 312 * @param array $actions Array of actions and corresponding links. 313 * @return array List of actions and corresponding links. 314 */ 315 function bp_members_membership_requests_filter_signup_bulk_actions( $actions ) { 316 // Rename the "email" resend option when membership requests are active. 317 $actions['resend'] = esc_html_x( 'Approve', 'Pending signup action', 'buddypress' ); 318 return $actions; 319 } 320 add_filter( 'bp_members_ms_signup_bulk_actions', 'bp_members_membership_requests_filter_signup_bulk_actions' ); 321 322 /** 323 * Filter the "Last Sent" column header on the pending users table. 324 * 325 * @since 10.0.0 326 * 327 * @param array $columns Array of columns to display. 328 * @return array List of columns to display. 329 */ 330 function bp_members_membership_requests_filter_signup_table_date_sent_header( $columns ) { 331 $columns['date_sent'] = esc_html__( 'Approved', 'buddypress' ); 332 return $columns; 333 } 334 add_filter( 'bp_members_signup_columns', 'bp_members_membership_requests_filter_signup_table_date_sent_header' ); 335 add_filter( 'bp_members_ms_signup_columns', 'bp_members_membership_requests_filter_signup_table_date_sent_header' ); 336 337 /** 338 * Filter the "Last Sent" column message on the pending users table. 339 * 340 * @since 10.0.0 341 * 342 * @param string $message "Not yet sent" message. 343 * @param object|null $signup Signup object instance. 344 * @return string "Not yet approved" message, if needed. Unchanged message otherwise. 345 */ 346 function bp_members_membership_requests_filter_signup_table_unsent_message( $message, $signup ) { 347 if ( 0 === $signup->count_sent ) { 348 $message = esc_html__( 'Not yet approved', 'buddypress' ); 349 } 350 351 return $message; 352 } 353 add_filter( 'bp_members_signup_date_sent_unsent_message', 'bp_members_membership_requests_filter_signup_table_unsent_message', 10, 2 ); 354 add_filter( 'bp_members_ms_signup_date_sent_unsent_message', 'bp_members_membership_requests_filter_signup_table_unsent_message', 10, 2 ); 355 -
trunk/src/bp-members/classes/class-bp-members-admin.php
r13165 r13169 515 515 if ( ( ! bp_is_network_activated() && ! is_network_admin() ) || ( is_network_admin() && bp_is_network_activated() ) ) { 516 516 517 $signups_menu_label = __( 'Manage Signups', 'buddypress' ); 518 519 if ( bp_get_membership_requests_required() ) { 520 $signups_menu_label = __( 'Manage Pending Memberships', 'buddypress' ); 521 } 522 517 523 // Manage signups. 518 524 $hooks['signups'] = $this->signups_page = add_users_page( 519 __( 'Manage Signups', 'buddypress' ),520 __( 'Manage Signups', 'buddypress' ),525 $signups_menu_label, 526 $signups_menu_label, 521 527 $this->capability, 522 528 'bp-signups', … … 1688 1694 $allowed_actions = apply_filters( 'bp_signups_admin_allowed_actions', array( 'do_delete', 'do_activate', 'do_resend' ) ); 1689 1695 1690 // Prepare the display of the Community Profilescreen.1696 // Prepare the display of the Signups screen. 1691 1697 if ( ! in_array( $doaction, $allowed_actions ) || ( -1 == $doaction ) ) { 1692 1698 … … 1710 1716 ) ); 1711 1717 1718 $signup_help_content = '<p>' . esc_html__( 'Hovering over a row in the pending accounts list will display action links that allow you to manage pending accounts. You can perform the following actions:', 'buddypress' ) . '</p>'; 1719 1720 if ( bp_get_membership_requests_required() ) { 1721 $signup_help_content .= '<ul><li>' . esc_html__( '"Activate" will activate the user immediately without requiring that they validate their email.', 'buddypress' ) .'</li>' . 1722 '<li>' . esc_html__( '"Approve Request" or "Resend Approval" takes you to the confirmation screen before being able to send the activation link to the desired pending request. You can only send the activation email once per day.', 'buddypress' ) . '</li>'; 1723 1724 if ( bp_is_active( 'xprofile' ) ) { 1725 $signup_help_content .= '<li>' . esc_html__( '"Profile Info" will display extended profile information for the request.', 'buddypress' ) . '</li>'; 1726 } 1727 1728 $signup_help_content .= '<li>' . esc_html__( '"Delete" allows you to delete a pending account from your site. You will be asked to confirm this deletion.', 'buddypress' ) . '</li></ul>'; 1729 } else { 1730 $signup_help_content .= '<ul><li>' . esc_html__( '"Email" takes you to the confirmation screen before being able to send the activation link to the desired pending account. You can only send the activation email once per day.', 'buddypress' ) . '</li>' . 1731 '<li>' . __( '"Delete" allows you to delete a pending account from your site. You will be asked to confirm this deletion.', 'buddypress' ) . '</li></ul>'; 1732 } 1733 1734 $signup_help_content .= '<p>' . esc_html__( 'By clicking on a Username you will be able to activate a pending account from the confirmation screen.', 'buddypress' ) . '</p>' . 1735 '<p>' . __( 'Bulk actions allow you to perform these 3 actions for the selected rows.', 'buddypress' ) . '</p>'; 1736 1712 1737 get_current_screen()->add_help_tab( array( 1713 1738 'id' => 'bp-signups-actions', 1714 1739 'title' => __( 'Actions', 'buddypress' ), 1715 'content' => 1716 '<p>' . __( 'Hovering over a row in the pending accounts list will display action links that allow you to manage pending accounts. You can perform the following actions:', 'buddypress' ) . '</p>' . 1717 '<ul><li>' . __( '"Email" takes you to the confirmation screen before being able to send the activation link to the desired pending account. You can only send the activation email once per day.', 'buddypress' ) . '</li>' . 1718 '<li>' . __( '"Delete" allows you to delete a pending account from your site. You will be asked to confirm this deletion.', 'buddypress' ) . '</li></ul>' . 1719 '<p>' . __( 'By clicking on a Username you will be able to activate a pending account from the confirmation screen.', 'buddypress' ) . '</p>' . 1720 '<p>' . __( 'Bulk actions allow you to perform these 3 actions for the selected rows.', 'buddypress' ) . '</p>' 1740 'content' => $signup_help_content 1721 1741 ) ); 1722 1742 1723 1743 // Help panel - sidebar links. 1724 1744 get_current_screen()->set_help_sidebar( 1725 '<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' .1745 '<p><strong>' . esc_html__( 'For more information:', 'buddypress' ) . '</strong></p>' . 1726 1746 '<p>' . __( '<a href="https://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>' 1727 1747 ); … … 1736 1756 'heading_list' => __( 'Pending users list', 'buddypress' ), 1737 1757 ) ); 1758 1759 // Use thickbox to display the extended profile information. 1760 if ( bp_is_active( 'xprofile' ) || bp_members_site_requests_enabled() ) { 1761 wp_enqueue_style( 'thickbox' ); 1762 wp_enqueue_script( 1763 'bp-signup-preview', 1764 $this->js_url . 'signup-preview' . bp_core_get_minified_asset_suffix() . '.js', 1765 array( 'bp-thickbox', 'jquery' ), 1766 bp_get_version(), 1767 true 1768 ); 1769 wp_localize_script( 1770 'bp-signup-preview', 1771 'bpSignupPreview', 1772 array( 1773 'modalLabel' => __( 'Profile info preview', 'buddypress' ), 1774 ) 1775 ); 1776 } 1738 1777 1739 1778 } else { … … 2228 2267 2229 2268 case 'resend' : 2230 $header_text = __( 'Resend Activation Emails', 'buddypress' ); 2231 if ( 1 == count( $signup_ids ) ) { 2232 $helper_text = __( 'You are about to resend an activation email to the following account:', 'buddypress' ); 2269 2270 if ( bp_get_membership_requests_required() ) { 2271 $header_text = __( 'Approve Membership Requests', 'buddypress' ); 2272 if ( 1 === count( $signup_ids ) ) { 2273 $helper_text = __( 'You are about to send an approval email to the following user:', 'buddypress' ); 2274 } else { 2275 $helper_text = __( 'You are about to send approval emails to the following users:', 'buddypress' ); 2276 } 2233 2277 } else { 2234 $helper_text = __( 'You are about to resend an activation email to the following accounts:', 'buddypress' ); 2278 $header_text = __( 'Resend Activation Emails', 'buddypress' ); 2279 if ( 1 === count( $signup_ids ) ) { 2280 $helper_text = __( 'You are about to resend an activation email to the following account:', 'buddypress' ); 2281 } else { 2282 $helper_text = __( 'You are about to resend an activation email to the following accounts:', 'buddypress' ); 2283 } 2235 2284 } 2236 2285 break; 2286 2237 2287 } 2238 2288 … … 2263 2313 // Prefetch registration field data. 2264 2314 $fdata = array(); 2265 if ( 'activate' === $action && bp_is_active( 'xprofile') ) {2315 if ( bp_is_active( 'xprofile' ) && ( 'activate' == $action || ( 'resend' == $action && bp_get_membership_requests_required() ) ) ) { 2266 2316 $field_groups = bp_xprofile_get_groups( array( 2267 2317 'exclude_fields' => 1, … … 2287 2337 <ol class="bp-signups-list"> 2288 2338 <?php foreach ( $signups as $signup ) : 2289 $last_notified = mysql2date( 'Y/m/d g:i:s a', $signup->date_sent ); 2339 if ( $signup->count_sent > 0 ) { 2340 $last_notified = mysql2date( 'Y/m/d g:i:s a', $signup->date_sent ); 2341 } else { 2342 $last_notified = __( 'Not yet notified', 'buddypress' ); 2343 } 2290 2344 $profile_field_ids = array(); 2291 2345 … … 2299 2353 <strong><?php echo esc_html( $signup->user_login ) ?></strong> 2300 2354 2301 <?php if ( 'activate' == $action ) : ?>2355 <?php if ( 'activate' == $action || ( 'resend' == $action && bp_get_membership_requests_required() ) ) : ?> 2302 2356 <table class="wp-list-table widefat fixed striped"> 2303 2357 <tbody> … … 2317 2371 <tr> 2318 2372 <td class="column-fields"><?php echo esc_html( $fdata[ $pid ] ); ?></td> 2319 <td><?php echo $this->format_xprofile_field_for_display( $field_value ); ?></td>2373 <td><?php echo bp_members_admin_format_xprofile_field_for_display( $field_value ); ?></td> 2320 2374 </tr> 2321 2375 … … 2623 2677 * 2624 2678 * @since 2.8.0 2679 * @deprecated 10.0.0 2625 2680 * 2626 2681 * @param string|array $value Field value. … … 2628 2683 */ 2629 2684 protected function format_xprofile_field_for_display( $value ) { 2630 if ( is_array( $value ) ) { 2631 $value = array_map( array( $this, 'format_xprofile_field_for_display' ), $value ); 2632 $value = implode( ', ', $value ); 2633 } else { 2634 $value = stripslashes( $value ); 2635 $value = esc_html( $value ); 2636 } 2637 2638 return $value; 2685 _deprecated_function( __METHOD__, '10.0.0', 'bp_members_admin_format_xprofile_field_for_display' ); 2686 2687 return bp_members_admin_format_xprofile_field_for_display( $value ); 2639 2688 } 2640 2689 -
trunk/src/bp-members/classes/class-bp-members-list-table.php
r12591 r13169 28 28 29 29 /** 30 * Signup profile fields. 31 * 32 * @since 10.0.0 33 * 34 * @var array 35 */ 36 public $signup_field_labels = array(); 37 38 /** 30 39 * Constructor. 31 40 * … … 139 148 public function get_columns() { 140 149 141 /** 142 * Filters the single site Members signup columns. 143 * 144 * @since 2.0.0 145 * 146 * @param array $value Array of columns to display. 147 */ 148 return apply_filters( 'bp_members_signup_columns', array( 150 $columns = array( 149 151 'cb' => '<input type="checkbox" />', 150 152 'username' => __( 'Username', 'buddypress' ), … … 154 156 'date_sent' => __( 'Last Sent', 'buddypress' ), 155 157 'count_sent' => __( 'Emails Sent', 'buddypress' ) 156 ) ); 158 ); 159 160 /** 161 * Filters the single site Members signup columns. 162 * 163 * @since 2.0.0 164 * 165 * @param array $value Array of columns to display. 166 */ 167 return apply_filters( 'bp_members_signup_columns', $columns ); 157 168 } 158 169 … … 172 183 } 173 184 174 return $actions; 185 /** 186 * Filters the bulk actions for signups. 187 * 188 * @since 10.0.0 189 * 190 * @param array $actions Array of actions and corresponding labels. 191 */ 192 return apply_filters( 'bp_members_ms_signup_bulk_actions', $actions ); 175 193 } 176 194 … … 184 202 public function no_items() { 185 203 186 if ( bp_get_signup_allowed() ) {204 if ( bp_get_signup_allowed() || bp_get_membership_requests_required() ) { 187 205 esc_html_e( 'No pending accounts found.', 'buddypress' ); 188 206 } else { … … 343 361 public function column_name( $signup_object = null ) { 344 362 echo esc_html( $signup_object->user_name ); 363 364 // Insert the extended profile modal content required by thickbox. 365 if ( ! bp_is_active( 'xprofile' ) ) { 366 return; 367 } 368 369 $profile_field_ids = array(); 370 371 // Fetch registration field data once only. 372 if ( ! $this->signup_field_labels ) { 373 $field_groups = bp_xprofile_get_groups( 374 array( 375 'fetch_fields' => true, 376 'signup_fields_only' => true, 377 ) 378 ); 379 380 foreach ( $field_groups as $field_group ) { 381 foreach ( $field_group->fields as $field ) { 382 $this->signup_field_labels[ $field->id ] = $field->name; 383 } 384 } 385 } 386 387 bp_members_admin_preview_signup_profile_info( $this->signup_field_labels, $signup_object ); 345 388 } 346 389 … … 364 407 */ 365 408 public function column_registered( $signup_object = null ) { 366 echo mysql2date( 'Y/m/d ', $signup_object->registered );409 echo mysql2date( 'Y/m/d g:i:s a', $signup_object->registered ); 367 410 } 368 411 … … 375 418 */ 376 419 public function column_date_sent( $signup_object = null ) { 377 echo mysql2date( 'Y/m/d', $signup_object->date_sent ); 378 } 379 380 /** 381 * Display number of time an activation email has been sent. 420 if ( $signup_object->count_sent > 0 ) { 421 echo mysql2date( 'Y/m/d g:i:s a', $signup_object->date_sent ); 422 } else { 423 $message = __( 'Not yet notified', 'buddypress' ); 424 425 /** 426 * Filters the "not yet sent" message for "Last Sent" 427 * column in Manage Signups list table. 428 * 429 * @since 10.0.0 430 * 431 * @param string $message "Not yet sent" message. 432 * @param object|null $signup_object Signup object instance. 433 */ 434 $message = apply_filters( 'bp_members_signup_date_sent_unsent_message', $message, $signup_object ); 435 436 echo esc_html( $message ); 437 } 438 } 439 440 /** 441 * Display number of times an activation email has been sent. 382 442 * 383 443 * @since 2.0.0 -
trunk/src/bp-members/classes/class-bp-members-ms-list-table.php
r12591 r13169 28 28 29 29 /** 30 * Signup profile fields. 31 * 32 * @since 10.0.0 33 * 34 * @var array 35 */ 36 public $signup_field_labels = array(); 37 38 /** 30 39 * Constructor. 31 40 * … … 115 124 // Reset the screen id. 116 125 $this->screen->id = $reset_screen_id; 126 127 // Use thickbox to display the extended profile information. 128 if ( bp_is_active( 'xprofile' ) || bp_members_site_requests_enabled() ) { 129 add_thickbox(); 130 } 117 131 } 118 132 … … 126 140 public function get_columns() { 127 141 128 /** 129 * Filters the multisite Members signup columns. 130 * 131 * @since 2.0.0 132 * 133 * @param array $value Array of columns to display. 134 */ 135 return apply_filters( 'bp_members_ms_signup_columns', array( 142 $columns = array( 136 143 'cb' => '<input type="checkbox" />', 137 144 'username' => __( 'Username', 'buddypress' ), … … 141 148 'date_sent' => __( 'Last Sent', 'buddypress' ), 142 149 'count_sent' => __( 'Emails Sent', 'buddypress' ) 143 ) ); 150 ); 151 152 /** 153 * Filters the multisite Members signup columns. 154 * 155 * @since 2.0.0 156 * 157 * @param array $value Array of columns to display. 158 */ 159 return apply_filters( 'bp_members_ms_signup_columns', $columns ); 144 160 } 145 161 … … 159 175 } 160 176 161 return $actions; 177 /** 178 * Filters the bulk actions for signups. 179 * 180 * @since 10.0.0 181 * 182 * @param array $actions Array of actions and corresponding labels. 183 */ 184 return apply_filters( 'bp_members_ms_signup_bulk_actions', $actions ); 162 185 } 163 186 … … 170 193 */ 171 194 public function no_items() { 172 if ( bp_get_signup_allowed() ) {195 if ( bp_get_signup_allowed() || bp_get_membership_requests_required() ) { 173 196 esc_html_e( 'No pending accounts found.', 'buddypress' ); 174 197 } else { … … 329 352 public function column_name( $signup_object = null ) { 330 353 echo esc_html( $signup_object->user_name ); 354 355 // Insert the extended profile modal content required by thickbox. 356 if ( ! bp_is_active( 'xprofile' ) && ! bp_members_site_requests_enabled() ) { 357 return; 358 } 359 360 if ( bp_is_active( 'xprofile' ) ) { 361 $profile_field_ids = array(); 362 363 // Fetch registration field data once only. 364 if ( ! $this->signup_field_labels ) { 365 $field_groups = bp_xprofile_get_groups( 366 array( 367 'fetch_fields' => true, 368 'signup_fields_only' => true, 369 ) 370 ); 371 372 foreach ( $field_groups as $field_group ) { 373 foreach ( $field_group->fields as $field ) { 374 $this->signup_field_labels[ $field->id ] = $field->name; 375 } 376 } 377 } 378 } 379 380 bp_members_admin_preview_signup_profile_info( $this->signup_field_labels, $signup_object ); 331 381 } 332 382 … … 377 427 } 378 428 379 echo mysql2date( $date, $signup_object->date_sent ); 429 if ( $signup_object->count_sent > 0 ) { 430 echo mysql2date( $date, $signup_object->date_sent ); 431 } else { 432 $message = __( 'Not yet notified', 'buddypress' ); 433 434 /** 435 * Filters the "not yet sent" message for "Last Sent" 436 * column in Manage Signups list table. 437 * 438 * @since 10.0.0 439 * 440 * @param string $message "Not yet sent" message. 441 * @param object|null $signup_object Signup object instance. 442 */ 443 $message = apply_filters( 'bp_members_ms_signup_date_sent_unsent_message', $message, $signup_object ); 444 445 echo esc_html( $message ); 446 } 380 447 } 381 448
Note: See TracChangeset
for help on using the changeset viewer.