This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

BP_Members_Admin::get_user_notice()

Get admin notice when saving a user or member profile.

Description

Return

(array)

Source

File: bp-members/classes/class-bp-members-admin.php

462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
private function get_user_notice() {
 
    // Setup empty notice for return value.
    $notice = array();
 
    // Updates.
    if ( ! empty( $_REQUEST['updated'] ) ) {
        switch ( $_REQUEST['updated'] ) {
        case 'avatar':
            $notice = array(
                'class'   => 'updated',
                'message' => __( 'Profile photo was deleted.', 'buddyboss' )
            );
            break;
        case 'ham' :
            $notice = array(
                'class'   => 'updated',
                'message' => __( 'User removed as spammer.', 'buddyboss' )
            );
            break;
        case 'spam' :
            $notice = array(
                'class'   => 'updated',
                'message' => __( 'User marked as spammer. Spam users are visible only to site admins.', 'buddyboss' )
            );
            break;
        case 1 :
            $notice = array(
                'class'   => 'updated',
                'message' => __( 'Profile updated.', 'buddyboss' )
            );
            break;
        }
    }
 
    // Errors.
    if ( ! empty( $_REQUEST['error'] ) ) {
        switch ( $_REQUEST['error'] ) {
        case 'avatar':
            $notice = array(
                'class'   => 'error',
                'message' => __( 'There was a problem deleting that profile photo. Please try again.', 'buddyboss' )
            );
            break;
        case 'ham' :
            $notice = array(
                'class'   => 'error',
                'message' => __( 'User could not be removed as spammer.', 'buddyboss' )
            );
            break;
        case 'spam' :
            $notice = array(
                'class'   => 'error',
                'message' => __( 'User could not be marked as spammer.', 'buddyboss' )
            );
            break;
        case 1 :
            $notice = array(
                'class'   => 'error',
                'message' => __( 'An error occurred while trying to update the profile.', 'buddyboss' )
            );
            break;
        case 2:
            $notice = array(
                'class'   => 'error',
                'message' => __( 'Your changes have not been saved. Please fill in all required fields, and save your changes again.', 'buddyboss' )
            );
            break;
        case 3:
            $notice = array(
                'class'   => 'error',
                'message' => __( 'There was a problem updating some of your profile information. Please try again.', 'buddyboss' )
            );
            break;
        case 4:
            $notice = array(
                'class'   => 'error',
                'message' => stripcslashes( $_REQUEST['message'] )
            );
            break;
        }
    }
 
    return $notice;
}

Changelog

Changelog
Version Description
BuddyPress 2.1.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.