BP_Members_Admin::users_type_change_notice()

Display an admin notice upon profile type bulk update.

Description

Source

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

	public function users_type_change_notice() {
		$updated = isset( $_REQUEST['updated'] ) ? $_REQUEST['updated'] : false;

		// Display feedback.
		if ( $updated && in_array( $updated, array( 'member-type-change-error', 'member-type-change-success', 'member-type-change-owner-error' ), true ) ) {

			if ( 'member-type-change-error' === $updated ) {
				$notice = __( 'There was an error while changing the profile type. Please try again.', 'buddyboss' );
				$type   = 'error';
			} elseif ( 'member-type-change-owner-error' === $updated ) {
				$notice = __( 'You cannot assign yourself to this profile type as doing so would remove your Administrator role and lock you out of the WordPress admin. You first need to associate this profile type to the Administrator role, and then you can assign it to yourself.', 'buddyboss' );
				$type   = 'error';
			} else {
				$notice = __( 'Profile type was changed successfully.', 'buddyboss' );
				$type   = 'updated';
			}

			bp_core_add_admin_notice( $notice, $type );
		}
	}

Changelog

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