/example.php Secret
Last active
May 17, 2017 19:55
Revisions
-
Pebblo revised this gist
May 17, 2017 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,7 @@ <?php //Please do not include the opening PHP tag if you already have one //Function to allow you to use BuddyPress registration as for site registrations during the EE Checkout //and then redirect them back to the checkout. function tw_ee_bp_redirect($user_id) { $checkout = EE_Registry::instance()->SSN->checkout(); -
Pebblo created this gist
May 17, 2017 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ <?php //Please do not include the opening PHP tag if you already have one //Function to allow you to use BuddyPress registration as the 'alternative registration url' function tw_ee_bp_redirect($user_id) { $checkout = EE_Registry::instance()->SSN->checkout(); if( $checkout instanceof EE_Checkout ) { $user = get_user_by( 'id', $user_id); if( $user ) { wp_set_current_user( $user->ID, $user->user_login ); wp_set_auth_cookie( $user->ID ); do_action( 'wp_login', $user->user_login ); wp_safe_redirect( $checkout->reg_page_base_url ); exit; } } } add_action('bp_core_signup_user', 'tw_ee_bp_redirect', 100, 1);