• Resolved daledesilva

    (@daledesilva)


    Hi,
    I’ve create a wordpress site for my client where they can create various documents of a particular post type and then duplicate them so that an outside translator can edit the duplicate into a different language.

    Using the Members plugin, I’ve created a Translator role with the idea that the Translator will only be able to access those posts that have been specifically assigned as accessible by that role.

    The problem is, the Members plugin assigns no role to the posts by default (ie. For each post, in the meta box that says “Limit access to the content to users of the selected roles.” Nothing is checked by default… meaning anyone user can access the post.

    This means the client can easily forget to check this and a user assigned the role of Translator would be able to access posts they shouldn’t.

    Is there a way to change the default roles assigned each post so that all but Translator are checked by default?

Viewing 1 replies (of 1 total)
  • Plugin Author Caseproof

    (@caseproof)

    Hi @daledesilva

    If you want to check some roles by default in Content Permissions section for posts/pages, you can add this code at the end of your theme’s functions.php file:

    add_filter('members_default_post_roles', function($roles, $post_id) {
    	array_push($roles, 'editor');
    	return $roles;
    }, 10, 2);

    and adjust it as you want. In my example I’ve checked Editor role but you can change it or add more roles.

    Hopefully, that helps.

Viewing 1 replies (of 1 total)
  • The topic ‘Change default roles assigned to post type’ is closed to new replies.