bp_members_action_activate_account()
Catches and processes account activation requests.
Description
Source
File: bp-members/screens/activate.php
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | function bp_members_action_activate_account() { if ( ! bp_is_current_component( 'activate' ) ) { return ; } if ( is_user_logged_in() ) { return ; } if ( ! empty ( $_POST [ 'key' ] ) ) { $key = wp_unslash( $_POST [ 'key' ] ); // Backward compatibility with templates using `method="get"` in their activation forms. } elseif ( ! empty ( $_GET [ 'key' ] ) ) { $key = wp_unslash( $_GET [ 'key' ] ); } if ( empty ( $key ) ) { return ; } $bp = buddypress(); /** * Filters the activation signup. * * @since BuddyPress 1.1.0 * * @param bool|int $value Value returned by activation. * Integer on success, boolean on failure. */ $user = apply_filters( 'bp_core_activate_account' , bp_core_activate_signup( $key ) ); // If there were errors, add a message and redirect. if ( ! empty ( $user ->errors ) ) { bp_core_add_message( $user ->get_error_message(), 'error' ); bp_core_redirect( trailingslashit( bp_get_root_domain() . '/' . $bp ->pages->activate->slug ) ); } bp_core_add_message( __( 'Your account is now active!' , 'buddyboss' ) ); bp_core_redirect( add_query_arg( 'activated' , '1' , bp_get_activation_page() ) ); } |
Changelog
Version | Description |
---|---|
BuddyPress 3.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.