在BuddyPress中注册后重定向

时间:2011-05-26 作者:José Pablo Orozco Marín

在Buddypress中,注册第一步后,用户将被重定向到更改化身步骤。我正在试图找到一种重定向到备用页面的方法,例如:http://www.mysite.com/yeah Im使用以下代码,但Im不断重定向以更改化身页面。

function custom_filter_bp_signup() {

    global $current_site;

    return \'http://\' . $current_site->domain . $current_site->path . \'yeah\';

} 

add_filter(\'wp_signup_location\', \'custom_filter_bp_signup\');
欢迎任何帮助,

提前谢谢。

2 个回复
最合适的回答,由SO网友:José Pablo Orozco Marín 整理而成

Yeah I ge it:

function bp_redirect($user) {

    $redirect_url = \'http://www.mysite.com/yeah\';

    bp_core_redirect($redirect_url);

}

add_action(\'bp_core_signup_user\', \'bp_redirect\', 100, 1);
SO网友:Nick Budden
function your_function($signup) {
   // $signup is the user id of the person who has just been added  
}
add_filter( \'bp_core_activate_account\', \'your_function\' );
结束