mccawphoto
El Presidente
Friendly Neighbour
Member Likes (0)
I am using the Membership plugin on my site. I am also using Formidable pro to create forms on my site. What I want to do in one of my forms is check to see if the user that is logged in is a member or non-member. I have set up 3 Access Levels: Free, Club Member and Race Team Member.
How would I check to see if the logged in user is a paid member (ie. Club Member or Race Team Member) or a un paid member (non-member / Free)? Also in my check I want to say that they aren't a member if they aren't logged in.
How would I do this?
Thanks!

Responses (8)
Lifetime Member (joined June 2009) Likes (0)
@mccawphoto,
You're in luck. Barry from the beginning was so kind as to create some functions for that exact purpose.
You will find a whole bunch in the /membershipincludes/includes/functions.php file
Here are a few
So you will implement something like this...
Hope that gets you going ;)
Member (joined February 2012) Likes (0)
@Jonathan,
Thanks!
One question. If I want to check if a member is level_id 2 or 3 than would I put something like:
Thanks!
Lifetime Member (joined June 2009) Likes (0)
No, that won't work...
This is probably you best option, using subscription plans instead of levels:
You could also use
This checks that they are infact all paid up but only if your free user is a stranger meaning they are not an actual registered user who is active. registered inactive user will return false, which is good.
If one of your subscription plans is a free one then is_member and has_subscription won't work for you then you had best use code above.
I could be mistaken though, I appologize, it is very very late here my me and my old brain is suffering a little lol, could a staff member confirm?
Member (joined February 2012) Likes (0)
Actually I ended up using this:
if ( (current_user_on_level(2) || current_user_on_level(3)) ) {It seems to be working fine.
Thanks for all of your help!
Lifetime Member (joined June 2009) Likes (0)
Yes, that'll work. Sorry brain isn't all there. Thought you wanted different code for each subscription. Your way is much neater. lol.
All the best, off to bed
Support Kangaroo (joined March 2011) Likes (0)
Greetings mccawphoto & Jonathan,
Happy to see that you folks got this all worked out and thank you both for being WPMU Dev members!
Great job coding and debugging and you both get some rep points!
Cheers, Joe :-)
Member (joined February 2010) Likes (0)
thanks, this is exactly what i am looking for :)
Member (joined February 2012) Likes (0)
Glad it was helpful! Welcome to WPMU Dev!
Become a member