Saltar navegación

[Resuelto] Setting Author role to not be able to edit their published CCT posts

This support ticket is created hace 5 años, 6 meses. 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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: Asia/Kolkata (GMT+05:30)

Etiquetado: 

Este tema contiene 1 respuesta, tiene 2 mensajes.

Última actualización por Minesh hace 5 años, 6 meses.

Asistido por: Minesh.

Autor
Mensajes
#1257653

Tell us what you are trying to do?
Setting Author role to not be able to edit or delete their published custom content type ("Property") posts. They can only publish - they cannot edit or delete. If you try to do this in Access, it forces you to allow them to do all three.

Is there any documentation that you are following?
I have found functions.php snippets I am testing. Information on that below:

---

I tried the following on a test stage and it works. (code below)

However, once the Author publishes their Property post, it directs them to enlace oculto afterward, which then gives them access to publishing blogs - which we don't want.
We only want them to be able to publish a Property.

Is there a way to do what I am trying to do through Access?

Thanks,
Corey

---

FUNCTIONS SNIPPET:

/* Testing Removing Author Permission to edit or delete own posts */

function wpb_change_author_role(){
global $wp_roles;
$wp_roles->remove_cap( 'author', 'delete_posts' );
$wp_roles->remove_cap( 'author', 'delete_published_posts' );
$wp_roles->remove_cap( 'author', 'edit_published_posts' );
}
add_action('init', 'wpb_change_author_role');

#1257811

Minesh
Supporter

Idiomas: Inglés (English )

Zona horaria: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - there is no option to delete the "Edit own" and "Delete Own" capabilities with Toolset Types as when you set the "publish" it will automatically set "Edit own" and "Delete Own" capabilities as its required for publish capability.

I do not have any solution to offer here, maybe you should restrict the edit.php by some custom code/filter and redirect user by checking if user role is author and if they try to access the edit.php

Please check the following link that may help you to construct such a solution:
=> https://wordpress.stackexchange.com/questions/52114/admin-page-redirect