Widget Logic MemberPress custom user meta tip

Widget Logic MemberPress custom user meta tip

Widget Logic MemberPress custom user meta tip 2224 510 Ryan

On one of my sites I was trying to figure out how to use a MemberPress custom field checkbox value for showing a widget. One this particular site I had installed the Widget Logic plugin, this allows you to add conditions to the widget. After a few days I played around and finally figured it out.

current_user_can('mepr-active','rule: 101') && 
 get_user_meta(get_current_user_id(),mepr_i_want_more,true) == yes

This code has two conditions, first one is making sure the current user has access via a rule I have created in MemberPress. The second condition is the more custom one which is using a MemberPress custom field user meta mepr_i_want_more I created on the users account page that they see and is required. They select yes or no for the value, if it is set to yes then this widget will show.

Privacy Preferences

When you visit our website, it may store information through your browser from specific services, usually in the form of cookies. Here you can change your Privacy preferences. It is worth noting that blocking some types of cookies may impact your experience on our website and the services we are able to offer.

Our website uses cookies, mainly from 3rd party services. Define your Privacy Preferences and/or agree to our use of cookies.