BP_Core_Members_Switching::get_redirect( WP_User $new_user = null, WP_User $old_user = null )
Fetches the URL to redirect to for a given user (used after switching).
Description
Parameters
- $new_user
-
(Optional) The new user's WP_User object.
Default value: null
- $old_user
-
(Optional) The old user's WP_User object.
Default value: null
Return
(string) The URL to redirect to.
Source
File: bp-members/classes/class-bp-core-members-switching.php
protected static function get_redirect( WP_User $new_user = null, WP_User $old_user = null ) { if ( ! $new_user ) { $redirect_to = bp_core_get_user_domain( $old_user->ID ); } else { $redirect_to = bp_core_get_user_domain( $new_user->ID ); } return $redirect_to; }
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.