diff --git src/bp-members/bp-members-invitations.php src/bp-members/bp-members-invitations.php
index 4a7951f24..75cb997ca 100644
|
|
function bp_members_invitations_complete_signup( $user_id, $user_login = '', $us |
126 | 126 | // User has already verified their email by responding to the invitation, so we can activate. |
127 | 127 | $key = bp_get_user_meta( $user_id, 'activation_key', true ); |
128 | 128 | if ( $key ) { |
| 129 | $redirect = bp_get_activation_page(); |
| 130 | |
129 | 131 | /** |
130 | 132 | * Filters the activation signup. |
131 | 133 | * |
… |
… |
function bp_members_invitations_complete_signup( $user_id, $user_login = '', $us |
138 | 140 | |
139 | 141 | // If there were errors, add a message and redirect. |
140 | 142 | if ( ! empty( $user->errors ) ) { |
| 143 | /** |
| 144 | * Filter here to redirect the User to a different URL than the activation page. |
| 145 | * |
| 146 | * @since 10.0.0 |
| 147 | * |
| 148 | * @param string $redirect The URL to use to redirect the user. |
| 149 | * @param WP_Error $user The WP Error object. |
| 150 | */ |
| 151 | $redirect = apply_filters( 'bp_members_invitations_activation_errored_redirect', $redirect, $user ); |
| 152 | |
141 | 153 | bp_core_add_message( $user->get_error_message(), 'error' ); |
142 | | bp_core_redirect( trailingslashit( bp_get_root_domain() . '/' . $bp->pages->activate->slug ) ); |
| 154 | bp_core_redirect( $redirect ); |
143 | 155 | } |
144 | 156 | |
| 157 | /** |
| 158 | * Filter here to redirect the User to a different URL than the activation page. |
| 159 | * |
| 160 | * @since 10.0.0 |
| 161 | * |
| 162 | * @param string $redirect The URL to use to redirect the user. |
| 163 | */ |
| 164 | $redirect = apply_filters( 'bp_members_invitations_activation_successed_redirect', $redirect ); |
| 165 | |
145 | 166 | bp_core_add_message( __( 'Your account is now active!', 'buddypress' ) ); |
146 | | bp_core_redirect( add_query_arg( 'activated', '1', bp_get_activation_page() ) ); |
| 167 | bp_core_redirect( add_query_arg( 'activated', '1', $redirect ) ); |
147 | 168 | } |
148 | 169 | } |
149 | 170 | add_action( 'bp_core_signup_user', 'bp_members_invitations_complete_signup', 10, 4 ); |
diff --git src/bp-members/screens/activate.php src/bp-members/screens/activate.php
index 581a6fd7d..2fc9e7e96 100644
|
|
function bp_members_action_activate_account() { |
85 | 85 | return; |
86 | 86 | } |
87 | 87 | |
88 | | $bp = buddypress(); |
| 88 | $bp = buddypress(); |
| 89 | $redirect = bp_get_activation_page(); |
89 | 90 | |
90 | 91 | /** |
91 | 92 | * Filters the activation signup. |
… |
… |
function bp_members_action_activate_account() { |
99 | 100 | |
100 | 101 | // If there were errors, add a message and redirect. |
101 | 102 | if ( ! empty( $user->errors ) ) { |
| 103 | /** |
| 104 | * Filter here to redirect the User to a different URL than the activation page. |
| 105 | * |
| 106 | * @since 10.0.0 |
| 107 | * |
| 108 | * @param string $redirect The URL to use to redirect the user. |
| 109 | * @param WP_Error $user The WP Error object. |
| 110 | */ |
| 111 | $redirect = apply_filters( 'bp_members_action_activate_errored_redirect', $redirect, $user ); |
| 112 | |
102 | 113 | bp_core_add_message( $user->get_error_message(), 'error' ); |
103 | | bp_core_redirect( trailingslashit( bp_get_root_domain() . '/' . $bp->pages->activate->slug ) ); |
| 114 | bp_core_redirect( $redirect ); |
104 | 115 | } |
105 | 116 | |
| 117 | /** |
| 118 | * Filter here to redirect the User to a different URL than the activation page. |
| 119 | * |
| 120 | * @since 10.0.0 |
| 121 | * |
| 122 | * @param string $redirect The URL to use to redirect the user. |
| 123 | */ |
| 124 | $redirect = apply_filters( 'bp_members_action_activate_successed_redirect', $redirect ); |
| 125 | |
106 | 126 | bp_core_add_message( __( 'Your account is now active!', 'buddypress' ) ); |
107 | | bp_core_redirect( add_query_arg( 'activated', '1', bp_get_activation_page() ) ); |
| 127 | bp_core_redirect( add_query_arg( 'activated', '1', $redirect ) ); |
108 | 128 | |
109 | 129 | } |
110 | | add_action( 'bp_actions', 'bp_members_action_activate_account' ); |
111 | | No newline at end of file |
| 130 | add_action( 'bp_actions', 'bp_members_action_activate_account' ); |