Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a site with authors from different locations. I have created a taxonomy called locations and has different countries (ex. Canada, Germany). Each author need only to see his country's post for the admin. For example, the author of Canada only can see and edit the post of Canada. Its is just for the admin, not the frontend.

Authors should never ever be able to see any other posts.

It is possible to limit posts by taxonomy in the admin?

thanks!

share|improve this question
    
How hard is this requirement? I mean on the scale from "author should see posts from country by default" to "author should never ever be able to see any other posts"? –  Rarst Jun 17 '13 at 15:12
    
sorry, I just edit the question, the authors should never ever be able to see any other posts. Only admin users can see other posts –  leandro Jun 17 '13 at 15:29
    
Are those authors able to change the custom taxonomy? –  brasofilo Jun 23 '13 at 16:33

1 Answer 1

up vote 0 down vote accepted

the solution:

function parse_query_useronly( $wp_query ) {

  if ( is_admin() && strpos( $_SERVER['REQUEST_URI'], '/wp-admin/edit.php' ) !== false ){         
        $wp_query->set( "location", get_user_role_location());
    }
}

add_filter('parse_query', 'parse_query_useronly' );
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.