Widget Logic MemberPress custom user meta tip

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.

Leave a Comment