Skip to content

Instantly share code, notes, and snippets.

@jb510
Created March 30, 2022 07:15
Show Gist options
  • Save jb510/5a1ae406ef5e3bf11a5a75716cac93d9 to your computer and use it in GitHub Desktop.
Save jb510/5a1ae406ef5e3bf11a5a75716cac93d9 to your computer and use it in GitHub Desktop.
Members Plugin set default content protection roles by Custom Post Type
<?php
add_filter( 'members_default_post_roles', 's9_members_force_content_protection' );
function s9_members_force_content_protection( $roles ) {
if ( 'minutes' === get_post_type( get_the_ID() ) ) {
$roles = array( 'board_member', 'home_owner' );
}
return $roles;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment