bp_core_screen_activation()
Handle the loading of the Activate screen.
Description
Source
File: bp-members/screens/activate.php
function bp_core_screen_activation() {
// Bail if not viewing the activation page.
if ( ! bp_is_current_component( 'activate' ) ) {
return false;
}
// If the user is already logged in, redirect away from here.
if ( is_user_logged_in() ) {
// If activation page is also front page, set to members directory to
// avoid an infinite loop. Otherwise, set to root domain.
$redirect_to = bp_is_component_front_page( 'activate' )
? bp_get_members_directory_permalink()
: bp_get_root_domain();
// Trailing slash it, as we expect these URL's to be.
$redirect_to = trailingslashit( $redirect_to );
/**
* Filters the URL to redirect logged in users to when visiting activation page.
*
* @since BuddyPress 1.9.0
*
* @param string $redirect_to URL to redirect user to.
*/
$redirect_to = apply_filters( 'bp_loggedin_activate_page_redirect_to', $redirect_to );
// Redirect away from the activation page.
bp_core_redirect( $redirect_to );
}
// Get BuddyPress.
$bp = buddypress();
/**
* Filters the template to load for the Member activation page screen.
*
* @since BuddyPress 1.1.1
*
* @param string $value Path to the Member activation template to load.
*/
bp_core_load_template( apply_filters( 'bp_core_template_activate', array( 'activate', 'registration/activate' ) ) );
}
Changelog
| Version | Description |
|---|---|
| BuddyPress 1.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.