Forum Replies Created
-
AuthorPosts
-
StephenParticipant
Ok, I think I have this figured out. I found the correct capabilities to add for subscribers to edit and delete their own events. As I mentioned, since this is for an intranet we’re not as concerned with the normal moderation process.
Anyway, here’s the code if anyone else would like it:
if( $blog_id == ’14’ ) {// get the role object
$role_object = get_role( ‘subscriber’ );
$role_object->add_cap( ‘edit_published_tribe_events’ );
$role_object->add_cap( ‘delete_published_tribe_events’ );
}The if statement is optional – I wanted to restrict it to a specific subsite.
StephenParticipantHi Barry–
Thanks for moving the post to the correct forum. My apologies for sticking it in the wrong place.
StephenParticipantOk – a little further testing revealed something.
If I change the default status of a post to be “draft” instead of published then the edit and delete links show up correctly. Seems that if events are set to be immediately published then the subscriber is no longer able to edit them.
Is there a way to adjust the role? Something like:
$role_object = get_role( ‘subscriber’ );
$role->add_cap( ‘edit_published_events’ );
$role->add_cap( ‘delete_published_events’ );WIth that being said, I’m hoping if we can do something like that that it doesn’t enable a subscriber to edit/delete any event (even ones they didn’t create).
-
AuthorPosts