Skip to:
Content
Pages
Categories
Search
Top
Bottom

Code to redirect users in backend

  • @footybible

    Participant

    Hi all.

    Having hidden aspects of the menu in the backend I now want to block access to a number of functions. I found the below code which does the trick nicely:

    function profile_redirect() {
    $result = stripos($_SERVER, ‘profile.php’);
    if ($result!==false) {
    wp_redirect(get_option(‘siteurl’) . ‘/wp-admin/index.php’);
    }
    }

    add_action(‘admin_menu’, ‘profile_redirect’);

    However, I need to include more .php files in this function and, unfortunately, my coding skills are rater limited. Can anyone help me out? Thanks.

  • The topic ‘Code to redirect users in backend’ is closed to new replies.
Skip to toolbar