wp-login redirect to another link
-
Hi,
how can I do this:
– user access with user + password
– if $user_level of user <> 10 redirect to specific url (example: https://www.name.it)I’ve change wp-login.php but don’t run:
get_currentuserinfo() ;
global $user_level;echo $user_level;
if ($user_level != 10) {
$redirect_to = “https://www.ilmobileclassico.it/”;
} else {
$redirect_to = admin_url();
}
I’ve insert the code in file wp-login.php in the code:
if ( isset( $_REQUEST[‘redirect_to’] ) ) {
$redirect_to = $_REQUEST[‘redirect_to’];
// Redirect to https if user wants ssl
if ( $secure_cookie && false !== strpos($redirect_to, ‘wp-admin’) )$redirect_to = preg_replace(‘|^https://|’, ‘https://’, $redirect_to);
} else {
********** MY CODE **************
}
Any idea?
thanks
- The topic ‘wp-login redirect to another link’ is closed to new replies.