Skip Navigation

[Gelöst] Setting Author role to not be able to edit their published CCT posts

This support ticket is created vor 3 Jahre, 4 Monate. 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.

This topic contains 1 Antwort, has 2 Stimmen.

Last updated by Minesh vor 3 Jahre, 4 Monate.

Assigned support staff: Minesh.

Author
Artikel
#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 hidden link 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

Languages: Englisch (English )

Timezone: 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