Skip Navigation

[Resolved] How to add a capability to edit but not create to a custom Role

This support ticket is created 3 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

This topic contains 1 reply, has 2 voices.

Last updated by Jamal 3 years, 4 months ago.

Assisted by: Jamal.

Author
Posts
#1873437

Hello, i've create a custom role that should have the capability to edit his own posts (created by an admin and related to him) but not creating new ones. So, an admin create a custom post, he set this to a user with the custom role, and that user can only edit that posts. How can I do that?

#1873991

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello and thank you for contacting the Toolset support.

WordPress has six pre-defined roles: Super Admin, Administrator, Editor, Author, Contributor, and Subscriber. Each role is allowed to perform a set of tasks called Capabilities. Read more about it here https://wordpress.org/support/article/roles-and-capabilities/#contributor

But WordPress does not have a "Create post" capability, instead, it uses the "Publish post" capability. For example, the Contributor role can create new posts, but can't publish them. If you want to restrict the creation of posts for this role, you will need to implement it using custom code.

I run a small test where I created a custom post type(Classes) and a custom role(Teacher), teachers can create new Classes posts, but they cannot publish them. You can check it by logging(as an admin) in with the following URL hidden link

I created a teacher user that holds the following credentials: john / john@123123
I'll let you check this test installation while it is always active, it will expire in 7 days.

I hope this helps. Let me know if you have any questions.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.