2012-06-22 19 views
1

我想在創建新帳戶時強制在特殊頁面上重定向,但它不起作用。它總是重定向到WP儀表板。如何在Wordpress中強制重定向新帳戶?

function redirect_testtt($user_id) { 
    wp_redirect('http://www.example.com/me'); 
    exit; 
} 
add_action('user_register', 'redirect_testtt'); 

如何強制重定向一個新帳戶?

回答

0

嘗試:

// add action to after registration hook 
add_action('user_register','after_reg'); 

// redirect users after registration 
function after_reg() { 
    wp_redirect('http://google.com'); 
    exit(); 
} 
+0

的區別是什麼......? – Steffi

+0

區別在於它的工作原理。 –

相關問題