We are building a site that will have 10-15 photographers posting content.
There will be a common blog + each admin has their own portfolio to manage. “Portfolio galleries” and “portfolio pages” are two custom types and they are categorized using “Artist”, a custom taxonomy.
We would like all admins:
- to be able to see all blog posts
- be able to post in the blog
- be able to add new “portfolio galleries” and “portfolio pages” and have them automatically tagged with the “artist” taxonomy with the same value as their name (i.e. John Smith will be able to only create portfolio pages and galleries automatically tagged with *Artist = “John Smith”*)
- be able to only view portfolio pages and galleries that belong to them (i.e. John Smith will only see portfolio pages and galleries that are marked with *Artist = “John Smith”*)
Finally we would also like to have a couple of “super admins” that will have access to every post on the site.
Any ideas on how to go building something like this? Is it even feasible?
EDIT
Following @×× ××ת ×תר×× suggestion I have read a bit more about Roles and Capabilities and realized that WordPress already supports out of the box the ability to limit users from editing other people’s posts. All I needed to do was to switch all the users to be Authors instead of Editors.
In brief #1, #2 and #4 from the above list are resolved. I still need to get #3 to work using save_post
.
Short: yes you can do that.
the default editor role can manage to see all posts
again the default editor role can manage to see all posts
For that you can use the
save_post
hook and automatically add there username as taxonomy.when registering post types you can define capabilities for that post type and you need to define edit_others_posts as false, also make sure that your post type supports author.
the default admin role is your friend in this case.
basically most of your issues are with Roles and Capabilities
hope this helps
If I will be the one building that site, this is what I’ll do for the “View Portfolio Pages and Galleries that belong to them”:
1.) I’ll create a new page template, say
template-portfolio.php
inside your themes directory, that goes something like this:2.) I would create a Page in wordpress and assign Portfolio as the Page Template
3.) I would view the Page using page preview, and if it works, I’ll pat myself in the back 😉
You can do a variant of the flow here for your other concerns.