• montanaflynn949

    (@montanaflynn949)


    I have a site which I set up for people to add posts, the problem is I don’t want them to go to the dashboard, but directly to the Posts tab. How can I redirect all contributers directly to the Posts tab?

Viewing 1 replies (of 1 total)
  • Thread Starter montanaflynn949

    (@montanaflynn949)

    Ok got it working with the following code, hope someone can benefit from it:

    if ( current_user_can('contributor') && !current_user_can('upload_files') )
    	add_action('admin_init', 'redirect_to_posts');
    
    function redirect_to_posts() {
    	$uri = $_SERVER['REQUEST_URI'];
    
    	if ($uri == '/wp-admin/index.php' || $uri == '/wp-admin/' ) {
    			wp_redirect('http://www.superwebsdirectory.com/wp-admin/edit.php');
    	} 
    
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Send certain roles directly to posts page’ is closed to new replies.