Created
December 5, 2016 19:58
-
-
Save thomasplevy/087d4e1b3eaa7ff6f023c88580faa7ef to your computer and use it in GitHub Desktop.
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 // don't copy this line to your theme's functions.php file | |
/** | |
* Add LifterLMS membership restrictions to a custom post type | |
* @param array $post_types array of custom post types | |
* @return array | |
*/ | |
function my_membership_restriction_post_types( $post_types ) { | |
array_push( $post_types, 'my_custom_post_type' ); | |
return $post_types; | |
} | |
add_filter( 'llms_membership_restricted_post_types', 'my_membership_restriction_post_types' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment