Skip to content

Instantly share code, notes, and snippets.

@jb510
Created March 30, 2022 07:15
Show Gist options
  • Select an option

  • Save jb510/5a1ae406ef5e3bf11a5a75716cac93d9 to your computer and use it in GitHub Desktop.

Select an option

Save jb510/5a1ae406ef5e3bf11a5a75716cac93d9 to your computer and use it in GitHub Desktop.

Revisions

  1. jb510 created this gist Mar 30, 2022.
    8 changes: 8 additions & 0 deletions members-protect-cpt-default-roles.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    <?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;
    }