滤器\'login_redirect\'
.
未测试的示例代码:
add_filter( \'wp_login\', \'wpse_78150_login_redirect\' );
function wpse_78150_login_redirect( $url )
{
# uncomment the next line for debugging
# var_dump( wp_get_current_user() ); exit;
if ( ! current_user_can( \'custom_role\' ) )
return $url;
return admin_url();
}