WordPress.org

Ready to get started?Download WordPress

Forums

wp-login redirect to another link (2 posts)

  1. sdamy
    Member
    Posted 4 years ago #

    Hi,

    how can I do this:

    - user access with user + password
    - if $user_level of user <> 10 redirect to specific url (example: http://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 = "http://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('|^http://|', 'https://', $redirect_to);

    } else {

    ********** MY CODE **************

    }

    Any idea?

    thanks

  2. MichaelH
    Member
    Posted 4 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic