2017-01-05 11 views

答えて

1

あなたのアクティブなテーマのfunctions.php

function my_login_redirect($redirect_to, $request, $user) { 
    //is there a user to check? 
    if (isset($user->roles) && is_array($user->roles)) { 
     //check for admins 
     if (in_array('administrator', $user->roles)) { 
      // redirect them to the default place 
      return home_url()."/wp-admin/admin.php?page=wc-reports"; 
     } else { 
      return home_url(); 
     } 
    } else { 
     return $redirect_to; 
    } 
} 

add_filter('login_redirect', 'my_login_redirect', 10, 3); 
+0

で、この次のコードを追加し、それをテストし、完璧に動作します。私のニーズに少しカスタマイズする必要があったが、ありがとう! – Amjad

+0

歓迎します;) –

関連する問題