@wp_kouhai
10 years, 9 months ago
I have found and corrected the issue.
function buddypress_redirect_if_no_avatar($redirect_url,$request_url,$user) { $avatar = bp_core_fetch_avatar( array( 'item_id' => $user->ID, 'no_grav' => true, 'html'=>false) ); $pos = strpos($avatar, 'mystery-man'); if ($pos === false) { return "/";} else { $redirect_url = bp_core_get_user_domain($user->ID)."/profile/change-avatar/"; return $redirect_url; } } add_filter("login_redirect","buddypress_redirect_if_no_avatar",100,3);