bp_current_member_switched()

Returns whether or not the current user switched into their account.

Description

Return

(false|WP_User) False if the user isn't logged in or they didn't switch in; old user object (which evaluates to true) if the user switched into the current user account.

Source

File: bp-members/bp-members-functions.php

function bp_current_member_switched() {
	if ( ! is_user_logged_in() ) {
		return false;
	}

	return BP_Core_Members_Switching::get_old_user();
}

Changelog

Changelog
Version Description
BuddyBoss 1.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.