Last active
December 29, 2015 13:19
-
-
Save BRMatt/7676832 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 | |
function is_protected_post( $post_id = NULL ) { | |
global $post; | |
if ( $post_id === NULL ) | |
$post_id = $post->ID; | |
foreach ( array(Memberful_Post_ACL::PRODUCT, Memberful_Post_ACL::SUBSCRIPTION) as $check ) { | |
$manager = new Memberful_Post_ACL( $post_id, $check ); | |
$acl = $manager->get_acl(); | |
if ( ! empty( $acl ) ) | |
return true; | |
} | |
return false; | |
} | |
?> | |
<?php if(is_protected_post()): ?> | |
<img src="..." /> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment