I am trying to only show pages that a user is the author of for any role other than administrator. The code below seems to put the site in an infinite loop and it ultimately dies.
add_action( 'load-edit.php', function()
{
global $typenow;
if( 'page' !== $typenow )
return;
if( current_user_can('add_users') )
return;
if( !isset( $_GET['post_status'] ) && !isset( $_GET['all_posts'] ) )
{
wp_redirect( admin_url('edit.php?author_name=joe&post_type=page') );
exit();
}
});