Changeset 11406 for trunk/src/bp-members/classes/class-bp-members-admin.php
- Timestamp:
- 01/31/2017 08:42:48 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-members/classes/class-bp-members-admin.php
r11360 r11406 2041 2041 ); 2042 2042 2043 // Prefetch registration field data. 2044 $fdata = array(); 2045 if ( 'activate' === $action && bp_is_active( 'xprofile' ) ) { 2046 $fields = bp_xprofile_get_groups( array( 2047 'profile_group_id' => 1, 2048 'exclude_fields' => 1, 2049 'update_meta_cache' => false, 2050 'fetch_fields' => true, 2051 ) ); 2052 $fields = $fields[0]->fields; 2053 foreach( $fields as $f ) { 2054 $fdata[ $f->id ] = $f->name; 2055 } 2056 } 2057 2043 2058 ?> 2044 2059 … … 2049 2064 <ol class="bp-signups-list"> 2050 2065 <?php foreach ( $signups as $signup ) : 2051 2052 $last_notified = mysql2date( 'Y/m/d g:i:s a', $signup->date_sent ); ?> 2066 $last_notified = mysql2date( 'Y/m/d g:i:s a', $signup->date_sent ); 2067 2068 // Get all xprofile field IDs except field 1. 2069 $profile_field_ids = array_flip( explode( ',', $signup->meta['profile_field_ids'] ) ); 2070 unset( $profile_field_ids[1] ); 2071 ?> 2053 2072 2054 2073 <li> 2055 <?php echo esc_html( $signup->user_name ) ?> - <?php echo sanitize_email( $signup->user_email );?> 2074 <strong><?php echo esc_html( $signup->user_login ) ?></strong> 2075 2076 <?php if ( 'activate' == $action ) : ?> 2077 <table class="wp-list-table widefat fixed striped"> 2078 <tbody> 2079 <tr> 2080 <td class="column-fields"><?php esc_html_e( 'Display Name', 'buddypress' ); ?></td> 2081 <td><?php echo esc_html( $signup->user_name ); ?></td> 2082 </tr> 2083 2084 <tr> 2085 <td class="column-fields"><?php esc_html_e( 'Email', 'buddypress' ); ?></td> 2086 <td><?php echo sanitize_email( $signup->user_email ); ?></td> 2087 </tr> 2088 2089 <?php if ( bp_is_active( 'xprofile' ) && ! empty( $profile_field_ids ) ) : ?> 2090 <?php foreach ( $profile_field_ids as $pid => $noop ) : 2091 $field_value = isset( $signup->meta[ "field_{$pid}" ] ) ? $signup->meta[ "field_{$pid}" ] : ''; ?> 2092 <tr> 2093 <td class="column-fields"><?php echo esc_html( $fdata[ $pid ] ); ?></td> 2094 <td><?php echo $this->format_xprofile_field_for_display( $field_value ); ?></td> 2095 </tr> 2096 2097 <?php endforeach; ?> 2098 2099 <?php endif; ?> 2100 2101 </tbody> 2102 </table> 2103 <?php endif; ?> 2056 2104 2057 2105 <?php if ( 'resend' == $action ) : ?> … … 2306 2354 } 2307 2355 } 2356 2357 /** 2358 * Formats a signup's xprofile field data for display. 2359 * 2360 * Operates recursively on arrays, which are then imploded with commas. 2361 * 2362 * @since 2.8.0 2363 * 2364 * @param string|array $value Field value. 2365 * @return string 2366 */ 2367 protected function format_xprofile_field_for_display( $value ) { 2368 if ( is_array( $value ) ) { 2369 $value = array_map( array( $this, 'format_xprofile_field_for_display' ), $value ); 2370 $value = implode( ', ', $value ); 2371 } else { 2372 $value = stripslashes( $value ); 2373 $value = esc_html( $value ); 2374 } 2375 2376 return $value; 2377 } 2308 2378 } 2309 2379 endif; // End class_exists check.
Note: See TracChangeset
for help on using the changeset viewer.