Skip to content

Instantly share code, notes, and snippets.

@strangerstudios
Last active July 10, 2017 14:34
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 strangerstudios/57c3e65848109eb8628bc39cd0e68618 to your computer and use it in GitHub Desktop.
Save strangerstudios/57c3e65848109eb8628bc39cd0e68618 to your computer and use it in GitHub Desktop.
have PMPro treat info notices like posts with regards to protecting by category #member #access
/**
* Have PMPro treat info notices like posts with regards to protecting by category
* Add this code to a custom plugin.
* #pmpro #notices
*/
function pmpro_membership_access_post_info_notice($post) {
if($post->post_type == 'info-notice')
$post->post_type = 'post';
return $post;
}
add_filter('pmpro_membership_access_post', 'pmpro_membership_access_post_info_notice');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment