S
S
starostyants2018-05-23 20:37:29
WordPress
starostyants, 2018-05-23 20:37:29

How to allow users to edit each other's posts?

There is a custom post type - psvideo (Video). Now users with different roles can create their own entries and see that there are strangers. On the first screen - the page from the administrator role (everything except the entry "42" - his), on the 2nd - the page from the custom role of the manager (his entry - "42"). How to add the possibility of mutual editing of records?
Thank you.
5b05a659d30db936209183.png5b05a6762f11c610985878.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
E, 2018-05-23
@aylo

if I'm not mistaken something like this

$public_roles = array( 'studio', 'producer' );

foreach ( $public_roles as $the_public_role ) {
    $role = get_role( $the_public_role );

    $role->add_cap( 'read_room' );
    $role->add_cap( 'edit_room' );
    $role->add_cap( 'edit_rooms' );
    $role->add_cap( 'edit_published_rooms' );
    $role->add_cap( 'publish_rooms' );
    $role->add_cap( 'delete_published_rooms' );
}

you need to look at caps, this code will not give such an opportunity, but the essence is

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question