1

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!

  • 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
0

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' );
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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