Hooks – show/hide content – user_has_subcription
-
Hi there guys,
Good plugin, many thanks for the work and effort you put into this.
I ran into this problem with the expired memberships and I was hoping that you could help me out. I’m just running out of options to try.
Basically, I’ve got 2 memberships setup, buyer/seller, both paid.
On my single product page ( theme template page ), I have a product enquiry form (this particular form is just one of the many other elements, but all work on the same basis, visible to active subscribers, hidden to everybody else. ) that I need to hide from non-buyers and non-sellers.
So the form is visible to all users who are on subscription buyer and seller, but is hidden to non-logged in or all others. If the subscription has expired, then the form should be hidden.
The code that i’m currently using is as follows:
<?php if (!is_user_logged_in()): ?> // Sign In Or Sign Up To See Form <?php elseif ( current_user_on_membership(6855) || current_user_on_membership(6878)): ?> // Show Form to Buyers-6855 and Sellers-6878 <?php else: ?> // Upgrade Your Subscription To See Form <?php endif; ?>
So basically, if not-logged in, form is hidden, sign-up link is visible, if user is either on Buyer (6855) or Seller (6878) subscription, the form is visible.
If the user is signed in, but don’t currently have any active subscription, the form should be hidden and just a link to update subscription visible.
I was hoping that this would work for the expired subscriptions, but it doesn’t seem to work like that.Is there any other piece of code that would work with expired subscriptions? Maybe
user_has_subcription
? Would this only count active subscriptions, not expired?Many thanks for your help.
- The topic ‘Hooks – show/hide content – user_has_subcription’ is closed to new replies.