1

I am trying to restrict content to users on a monthly basis. So when they become a member in a certain plan, they immediately get access to Month 1, then once they've been a member for a month, they get access to Month 1 & 2...

I know that I can restrict a page after a certain number of days, but I want to have a page that conditionally shows content based on whether they've been a member for X amount of time.

I am totally stumped on this. I have conditional PHP to check if a user is an active member of the plan, but how do I go a step further and calculate how long they've been a member?

<?php $user_id = get_current_user_id();

if ( wc_memberships_is_user_active_member( $user_id, 'member-package' ) ) { 
?> 

// I'm a member, show me member content!

<?php } else { ?>

// I'm not a member. Call to action to become one!

<?php } ?>

The closest related thing I found is this:

Woocommerce Subscriptions - Get Start date

Thank you.

Greg
  • 11
  • 2
  • You should give in this question (editing it), the code that you are using for **"conditional PHP to check if a user is an active member of the plan"** (as the actual linked code is not for WC Membership). Thanks – LoicTheAztec Dec 13 '17 at 04:24

0 Answers0