-
AuthorPosts
-
January 26, 2021 at 12:30 am #1275355
Hello,
Wonder if it is possible to remove Portfolio Item Edit/Delete capabilities from the Author Role?
I’ve tried using a plugin that will configure role capabilities (Members), however its looks like Porftolio Items are not listed.Also Tried to add to function file using… but No luck
'read_portfolios' 'edit_portfolios' 'delete_portfolios' 'publish_portfolios'
Any options on a function for this or other possibilities.
Thanks for your helpJanuary 27, 2021 at 12:46 pm #1275765Hey jberg1,
Thank you for the inquiry.
You may be able to use the get_role function to edit the capability of a certain user role.
// https://codex.wordpress.org/Function_Reference/get_role
You could also create a custom user role using the add_role function.
// https://developer.wordpress.org/reference/functions/add_role/
For a more detailed instruction on how to alter the capabilities of certain user roles, please check the following article.
// https://3.7designs.co/blog/2014/08/restricting-access-to-custom-post-types-using-roles-in-wordpress/
Best regards,
IsmaelJanuary 27, 2021 at 5:28 pm #1275838Thanks Ismael,
Yea, I’ve tried these however, I’m trying to set it for existing role of Author (actually disable for Author role). It doesn’t seem remove those capabilities at all. My main issue is when I use “portfolio” or “portfolio_item” it doesn’t work. And that plugin doesn’t even see the Portfolio as a post type to control capabilities for.I wonder if it could be that capabilities are not set on the post type when registered. There for I can’t set them per user.
Capabilities Mapping, As explainer here.
http://justintadlock.com/archives/2010/07/10/meta-capabilities-for-custom-post-typesWonder if it is possible to map those capabilities for the portfolio content type in a function in the child theme, without hacking the parent theme?
Thanks for your help.January 28, 2021 at 6:06 am #1275967Hi,
Thank you for the info.
You should be able to use the avf_portfolio_cpt_args filter to adjust the existing parameters of the portfolio post type and define the capabilities. And as recommended in the article, you have to use a membership plugin such as the wordpress.org/extend/plugins/members to be able to assign custom capabilities to user roles.
// https://memberpress.com/plugins/members/docs/
Please be very careful when assigning capabilities to user roles.
Best regards,
IsmaelApril 3, 2023 at 7:54 am #1403359Hi!
For a new restaurant and worker finder website we use portfolio items to present restaurants and other companies. For certain customers we want to give them the possibility to change and delete the own portfolio items. Is it possible to do it with the enfold theme?
Many thank for your answer.
ChrisApril 7, 2023 at 5:41 pm #1403831Hi,
Thank you for your patience, as Ismael advised above you will need to use a membership plugin to be able to assign custom capabilities to user roles to achieve this. I have not tested which membership plugins work well with Enfold, but Ismael recommends the Members plugin.Best regards,
Mike -
AuthorPosts
- You must be logged in to reply to this topic.