Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: redirecting to user domain using $bp


shaisimchi
Participant

@shaisimchi

I mean what is passed as the $user parameter.
it seems that the 2 redirect parameters are not in use and the $user – i am not sure how it is passed here.
I have tried to do something similar (dont worry about the mess now – I just want the redirect to work):
function my_login_redirect($redirect_to,$redirect_to2,$user_id) {

global $wpdb,$bp;
$user_id = $bp->loggedin_user->id;
$city = $wpdb->get_var($wpdb->prepare(“SELECT value FROM wp_bp_xprofile_data WHERE user_id=%d AND field_id=26” , $user_id ));
$state = $wpdb->get_var($wpdb->prepare(“SELECT value FROM wp_bp_xprofile_data WHERE user_id=%d AND field_id=27” , $user_id ));
$country = $wpdb->get_var($wpdb->prepare(“SELECT value FROM wp_bp_xprofile_data WHERE user_id=%d AND field_id=103” , $user_id ));
$zip = $wpdb->get_var($wpdb->prepare(“SELECT value FROM wp_bp_xprofile_data WHERE user_id=%d AND field_id=23” , $user_id ));
if (!$city || $city==”)
$has_city=0;
else
$has_city=1;
if (!$state || $state==”)
$has_state=0;
else
$has_state=1;
if (!$country || $country==”)
$has_country=0;
else
$has_country=1;
if (!$zip || $zip==”)
$has_zip=0;
else
$has_zip=1;
if ($has_city==1 && $has_state==1 && $has_country==1 && $has_zip==1 )
return ‘http://athleticrash.com’;
else
return bp_core_get_user_domain($user_id) . ‘profile/edit/’;
}
add_filter(‘login_redirect’,’my_login_redirect’,100,3);

this gave the same results – just went to the home page.

Skip to toolbar