Skip to content

Instantly share code, notes, and snippets.

@jpmarchand
Last active September 27, 2016 16:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpmarchand/2b3dffadd9a67dd3270d to your computer and use it in GitHub Desktop.
Save jpmarchand/2b3dffadd9a67dd3270d to your computer and use it in GitHub Desktop.
Make private posts visible to subscribers. Source: http://www.billerickson.net/code/private-posts-visible-to-subscribers/
<?php
//* Make private posts visible to subscribers
function customprefix_private_posts_subscribers() {
$subRole = get_role( 'subscriber' );
$subRole->add_cap( 'read_private_posts' );
}
add_action( 'init', 'customprefix_private_posts_subscribers' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment