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

Infusionsoft Username Field

This dropdown selects which fields in your Infusionsoft contact record is used to match the login name to. Currently we only support email fields, and we encourage you to use “Email” as your username. This provides the most reliability and maximum compatibility.

Read More »

How to Enable Your Customers To Update Their Credit Cards

While Memberium does not store your customer’s credit card information for security reasons, it does enable your members to add their updated cards through your website. Being able to update your customer’s card on file is a very important feature. Not only do cards regularly expire, but with credit card theft on the rise, it’s increasingly frequent that cards are replaced before their scheduled expiration date.

Read More »

How to Ghost an Image Block Based on Visitor Access

This article describes how to create a grid of images that are in full color, or are ghosted gray depending on your access to each item in the grid. We’ll explain the end-goal, and show you how to create a similar effect on your site by walking you through the process. You’ll see references to “ghosting”. This is the name for the effect of graying out a darker or colored element to show that it is not available. It’s a design pattern that goes back many years.

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.