[wp-hackers] Frontend Profile Editor

Joaquin Rodriguez Montero yojoaquin at gmail.com
Mon Aug 23 18:49:30 UTC 2010


A couple of redirects and a user profile page will do the trick

function remove_the_dashboard () {
    if (current_user_can('level_10') || current_user_can('level_7')) {
        return;
    } else {
        if ( preg_match('#wp-admin/#',$_SERVER['REQUEST_URI']))
        wp_redirect(get_option('siteurl') . '/profile/'); // this redirects
the non-admin/editor user to /profile page.
    }
}
add_action('admin_menu', 'remove_the_dashboard');


function redirect_logout() {
        if (
preg_match('#(wp-login.php)?(loggedout=true)#',$_SERVER['REQUEST_URI']))
        wp_redirect(get_option('siteurl') . '/profile/'); // after logout
redirects the non-admin/editor user to /profile page.
}
add_action('login_head', 'redirect_logout');

function redirectregister(){
    wp_redirect(get_option('siteurl') . '/profile/'); //login? redirect to
/profile
}
add_action('login_head', 'redirectregister');


More information about the wp-hackers mailing list