Created
March 30, 2022 07:15
-
-
Save jb510/5a1ae406ef5e3bf11a5a75716cac93d9 to your computer and use it in GitHub Desktop.
Members Plugin set default content protection roles by Custom Post Type
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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