<?php

$context = array();
$context['theme'] = get_template_directory_uri();

$current_user = wp_get_current_user();
$current_user_id = $current_user->ID;
if ($current_user_id == 0) {
    wp_redirect(get_site_url()."?page=login");
} else {
    $name = $current_user->user_login;
    $role = $current_user->roles[0];
    $user_role = '';
    switch ($role) {
        case 'administrator':

        case 'subscriber':
            $user_role = '用户';
            wp_redirect(get_site_url()."?page=myHouse");
            break;
        case 'editor':
            $user_role = '置业顾问';
            wp_redirect(get_site_url()."?page=list");
            break;
    }
}

?>