Skip to content

Instantly share code, notes, and snippets.

@BRMatt
Last active December 29, 2015 13:19
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 BRMatt/7676832 to your computer and use it in GitHub Desktop.
Save BRMatt/7676832 to your computer and use it in GitHub Desktop.
<?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