Created
October 4, 2016 14:25
-
-
Save mateusneves/d6a9f72ee7728df76bd8139d90e7973a to your computer and use it in GitHub Desktop.
Private posts for Subscribers
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
/** | |
* Private Posts visible to Subscribers | |
* Run once | |
* | |
*/ | |
function be_private_posts_subscribers() { | |
$subRole = get_role( 'subscriber' ); | |
$subRole->add_cap( 'read_private_posts' ); | |
} | |
add_action( 'init', 'be_private_posts_subscribers' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment