WordPress.org

Ready to get started?Download WordPress

Forums

Redirect Subscribers to index.php when they login (5 posts)

  1. Horak
    Member
    Posted 7 years ago #

    Hi

    I have read all the posts on the topic and I have found plugin http://www.deepwave.net/articles/hide_dashboard/
    and it works. At the moment the code sends subscribers to the profile page.

    I need to change the code to send them to the index page (or if possible to the page they were at when they decided to login)

    Here is the bit I think needs changing:`

    Release Date: 2007-01-05
    Copyright (c) 2007 Patrick Khoo
    */

    function dwpage_restrict_adminhead() {
    global $submenu, $menu;

    if(!current_user_can('level_10')){
    unset($menu[0]); // hide dashboard
    unset($menu[35]); // hide Users or Profile
    unset($submenu['profile.php']);
    }
    }

    function dwlogin_redirect($link) {
    if(!current_user_can('level_10')){
    $link = preg_replace("/Site Admin/", "My Profile", $link);
    $link = preg_replace("/\/wp-admin\//","/wp-admin/profile.php",$link);
    }
    return $link;
    }

    add_action('admin_head','dwpage_restrict_adminhead');
    add_filter('register', 'dwlogin_redirect');

    ?>`

    Thanks

    Johan

  2. Horak
    Member
    Posted 7 years ago #

    Hi
    Any ideas?
    Thanks
    Johan

  3. Horak
    Member
    Posted 7 years ago #

    Not worry
    I got hold of a great plugin that does the trick for me.
    http://www.thedailyblitz.org/weasels-login-redirect-text-replacement-plugin

  4. gspark
    Member
    Posted 6 years ago #

    that plugin is useless

  5. scottlenger
    Member
    Posted 6 years ago #

    replacing dwlogin with this will redirect to the edit page:

    function dwlogin_redirect() {
    global $redirect_to;
    if(!current_user_can('level_10')){

    $redirect_to = get_option('siteurl').'/wp-admin/edit.php';
    	}

    }

Topic Closed

This topic has been closed to new replies.

About this Topic