is_memberium_protected()

This function takes a post ID (or page Id, or custom post type ID), and returns a boolean true / false depending on whether or not that content is protected.

[php]
function is_memberium_protected( $post_id ) {
$post_id = (int) $post_id;
$post_metas = get_post_meta( $post_id );
$protection_keys = array(
‘_is4wp_access_tags’,
‘_is4wp_anonymous_only’,
‘_is4wp_any_loggedin_user’,
‘_is4wp_any_membership’,
‘_is4wp_contact_ids’,
‘_is4wp_membership_levels’,
);
foreach( $post_metas as $key => $value ) {
if ( in_array( $key, $protection_keys ) ) {
$value = implode( ”, $value );
if ( ! empty( $value ) ) {
return true;
}
}
}
return false;
}

[/php]

  • Was this Helpful?
  • YesNo
9 ways to add more value to your membership site

Table of Contents

Keep Reading

LearnDash Auto-Enroll Tags

In the Memberium / LearnDash system, Memberium controls VISIBILITY of the course; whether not a visitor on your site can see the course. Learndash controls whether or not you’re ENROLLED in the course and can take it.

Read More »

6 Ways You Can Use Memberium to Help Automate Your Business

When most people think of a “membership site,” they think of a website where you pay a monthly fee to get access to a bunch of videos and content.

While this is true for most sites, the truth is there’s so much more that a membership site can potentially help a business accomplish besides this.

A lot of tasks and processes, that generally involve a person having to do manually, can be automated with a membership site and Infusionsoft.

In this post we’ll show you 6 ways, besides just delivering info products and video content, that you can use Memberium for to help automate certain tasks or processes within your business.

Read More »

Want to get some fresh ideas on how you can improve your membership site or course?

Download our free ebook!

Book a Call

Welcome to Memberium!

We are very excited for you to be part of our family. 

We would love to answer any questions that you have!

Please choose the best time for you to get in a call with us. 

For Technical Support, you can contact us at https://keap.memberium.com/support/ or Email us at support@memberium.com.