0

I am looking to do the following:

Logic/layout/cores:

  1. All contributors select a school in a custom user profile meta field
  2. All contributors also select a club in a custom user profile meta field
  3. Editors also select a school and a club (same profile fields as above)

Goal: The editor (user role) that has School A and Club B stored as custom user values can view/edit/publish posts made ONLY by contributors (user role) who also have School A and Club B stored as custom user values.

All contributors should only be able to read/view their articles and media. (I currently am able to do that with this)

Based on this, I believe I'll need to be working with the following:

user_has_cap
get currentuserinfo
get_user_meta

By going through the following:

  • Check current logged in user ID, user role, custom meta - SCHOOL, and custom meta - CLUB. Store values.
  • If logged in user is an EDITOR, allow EDITOR to see all other users' posts ONLY if the other users have identical custom meta - SCHOOL and custom meta - CLUB values (to the EDITOR).
  • If logged in user is a CONTRIBUTOR, allow user to only see its own posts.

Does anyone have any ideas about how to best tackle this? Any guidance is much appreciated!

  • Are you still looking for an answer to this or were you able to figure it out? – Jonathan Wold Feb 19 '14 at 22:48
  • Partially figured out. I'll add code above shortly. – Caroline Feb 27 '14 at 2:37

Your Answer

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

Browse other questions tagged or ask your own question.