BP_Members_Admin::signups_admin_manage( string $action = '' )
This is the confirmation screen for actions.
Description
Parameters
- $action
-
(Optional) Delete, activate, or resend activation link.
Default value: ''
Return
(null|false)
Source
File: bp-members/classes/class-bp-members-admin.php
2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 | public function signups_admin_manage( $action = '' ) { if ( ! current_user_can( $this ->capability ) || empty ( $action ) ) { die ( '-1' ); } // Get the user IDs from the URL. $ids = false; if ( ! empty ( $_POST [ 'allsignups' ] ) ) { $ids = wp_parse_id_list( $_POST [ 'allsignups' ] ); } elseif ( ! empty ( $_GET [ 'signup_id' ] ) ) { $ids = absint( $_GET [ 'signup_id' ] ); } if ( empty ( $ids ) ) { return false; } // Query for signups, and filter out those IDs that don't // correspond to an actual signup. $signups_query = BP_Signup::get( array ( 'include' => $ids , ) ); $signups = $signups_query [ 'signups' ]; $signup_ids = wp_list_pluck( $signups , 'signup_id' ); // Set up strings. switch ( $action ) { case 'delete' : $header_text = __( 'Delete Pending Accounts' , 'buddyboss' ); if ( 1 == count ( $signup_ids ) ) { $helper_text = __( 'You are about to delete the following account:' , 'buddyboss' ); } else { $helper_text = __( 'You are about to delete the following accounts:' , 'buddyboss' ); } break ; case 'activate' : $header_text = __( 'Activate Pending Accounts' , 'buddyboss' ); if ( 1 == count ( $signup_ids ) ) { $helper_text = __( 'You are about to activate the following account:' , 'buddyboss' ); } else { $helper_text = __( 'You are about to activate the following accounts:' , 'buddyboss' ); } break ; case 'resend' : $header_text = __( 'Resend Activation Emails' , 'buddyboss' ); if ( 1 == count ( $signup_ids ) ) { $helper_text = __( 'You are about to resend an activation email to the following account:' , 'buddyboss' ); } else { $helper_text = __( 'You are about to resend an activation email to the following accounts:' , 'buddyboss' ); } break ; } // These arguments are added to all URLs. $url_args = array ( 'page' => 'bp-signups' ); // These arguments are only added when performing an action. $action_args = array ( 'action' => 'do_' . $action , 'signup_ids' => implode( ',' , $signup_ids ) ); if ( is_network_admin() ) { $base_url = network_admin_url( 'users.php' ); } else { $base_url = bp_get_admin_url( 'users.php' ); } $cancel_url = add_query_arg( $url_args , $base_url ); $action_url = wp_nonce_url( add_query_arg( array_merge ( $url_args , $action_args ), $base_url ), 'signups_' . $action ); // Prefetch registration field data. $fdata = array (); if ( 'activate' === $action && bp_is_active( 'xprofile' ) ) { $field_groups = bp_xprofile_get_groups( array ( 'exclude_fields' => 1, 'update_meta_cache' => false, 'fetch_fields' => true, ) ); foreach ( $field_groups as $fg ) { foreach ( $fg ->fields as $f ) { $fdata [ $f ->id ] = $f ->name; } } } ?> <div class = "wrap" > <h1><?php echo esc_html( $header_text ); ?></h1> <p><?php echo esc_html( $helper_text ); ?></p> <ol class = "bp-signups-list" > <?php foreach ( $signups as $signup ) : $last_notified = mysql2date( 'Y/m/d g:i:s a' , $signup ->date_sent ); $profile_field_ids = array (); // Get all xprofile field IDs except field 1. if ( ! empty ( $signup ->meta[ 'profile_field_ids' ] ) ) { $profile_field_ids = array_flip ( explode ( ',' , $signup ->meta[ 'profile_field_ids' ] ) ); unset( $profile_field_ids [1] ); } ?> <li> <strong><?php echo esc_html( $signup ->user_login ) ?></strong> <?php if ( 'activate' == $action ) : ?> <table class = "wp-list-table widefat fixed striped" > <tbody> <tr> <td class = "column-fields" ><?php esc_html_e( 'Display Name' , 'buddyboss' ); ?></td> <td><?php echo esc_html( $signup ->user_name ); ?></td> </tr> <tr> <td class = "column-fields" ><?php esc_html_e( 'Email' , 'buddyboss' ); ?></td> <td><?php echo sanitize_email( $signup ->user_email ); ?></td> </tr> <?php if ( bp_is_active( 'xprofile' ) && ! empty ( $profile_field_ids ) ) : ?> <?php foreach ( $profile_field_ids as $pid => $noop ) : $field_value = isset( $signup ->meta[ "field_{$pid}" ] ) ? $signup ->meta[ "field_{$pid}" ] : '' ; ?> <tr> <td class = "column-fields" ><?php echo esc_html( $fdata [ $pid ] ); ?></td> <td><?php echo $this ->format_xprofile_field_for_display( $field_value ); ?></td> </tr> <?php endforeach ; ?> <?php endif ; ?> </tbody> </table> <?php endif ; ?> <?php if ( 'resend' == $action ) : ?> <p class = "description" > <?php printf( esc_html__( 'Last notified: %s' , 'buddyboss' ), $last_notified ) ;?> <?php if ( ! empty ( $signup ->recently_sent ) ) : ?> <span class = "attention wp-ui-text-notification" > <?php esc_html_e( '(less than 24 hours ago)' , 'buddyboss' ); ?></span> <?php endif ; ?> </p> <?php endif ; ?> </li> <?php endforeach ; ?> </ol> <?php if ( 'delete' === $action ) : ?> <p><strong><?php esc_html_e( 'This action cannot be undone.' , 'buddyboss' ) ?></strong></p> <?php endif ; ?> <a class = "button-primary" href= "<?php echo esc_url( $action_url ); ?>" ><?php esc_html_e( 'Confirm' , 'buddyboss' ); ?></a> <a class = "button" href= "<?php echo esc_url( $cancel_url ); ?>" ><?php esc_html_e( 'Cancel' , 'buddyboss' ) ?></a> </div> <?php } |
Changelog
Version | Description |
---|---|
BuddyPress 2.0.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.