GeoDirectory SupportMembership Level Restrictions – GeoDirectory Support https://wpgeodirectory.com/support/topic/membership-level-restrictions/feed Sat, 21 Feb 2026 14:11:24 +0000 http://bbpress.org/?v=2.5.14-6684 en-US https://wpgeodirectory.com/support/topic/membership-level-restrictions/#post-27092 <![CDATA[Membership Level Restrictions]]> https://wpgeodirectory.com/support/topic/membership-level-restrictions/#post-27092 Mon, 12 Jan 2015 11:25:17 +0000 Ian Butler Hi,

I’m using GeoDirectory in conjunction with S2Members and BuddyPress.

I use S2Members to handle all membership sign-ups and would like to conditionally display content based on membership level.

I need to restrict BuddyPress Members from being able to upload Places/Events and instead have this for business owners only.

So for example the GD > Loginbox:My Dashboard widget should only display for Level 1 members and not Level 2.

Can you please advise on which template I would need to put the conditional in and how to futureproof this from any updates.

Thanks in advance

]]>
https://wpgeodirectory.com/support/topic/membership-level-restrictions/#post-27094 <![CDATA[Reply To: Membership Level Restrictions]]> https://wpgeodirectory.com/support/topic/membership-level-restrictions/#post-27094 Mon, 12 Jan 2015 11:35:33 +0000 Guust Have a look at s2member > restriction options > URI restrictions

So you would put /add-listing/ in the field for business owners (whatever level they are in your system).

That will stop members from adding listings, but will not remove from the dashboard widget.
One way that can be solved is to only use the buddypress login widget, and add the GD dashboard widget to protected page for business owners only.

]]>
https://wpgeodirectory.com/support/topic/membership-level-restrictions/#post-27096 <![CDATA[Reply To: Membership Level Restrictions]]> https://wpgeodirectory.com/support/topic/membership-level-restrictions/#post-27096 Mon, 12 Jan 2015 11:53:35 +0000 Ian Butler Thanks Guust,

I can add page level restrictions just fine but need to apply some widget logic.

For example in geodir-location.php i can wrap the right sidebar hook in this code

if (current_user_is(‘s2member_level4’)) {
###### SIDEBAR ######
do_action(‘geodir_location_sidebar_right’); }

That of course will remove the entire right sidebar unless the logged in member is Level 4.

What I’m trying to do is conditionally display just the dashboard widget, not the entire sidebar.

Is there a file where I can add my code to achieve this?

]]>
https://wpgeodirectory.com/support/topic/membership-level-restrictions/#post-27098 <![CDATA[Reply To: Membership Level Restrictions]]> https://wpgeodirectory.com/support/topic/membership-level-restrictions/#post-27098 Mon, 12 Jan 2015 11:55:44 +0000 Guust I’ll get Stiofan to look at your question.

]]>
https://wpgeodirectory.com/support/topic/membership-level-restrictions/#post-27100 <![CDATA[Reply To: Membership Level Restrictions]]> https://wpgeodirectory.com/support/topic/membership-level-restrictions/#post-27100 Mon, 12 Jan 2015 12:00:39 +0000 Stiofan O'Connor Would you not be better adding the restriction on the actual add listing page?

Stiofan

]]>
https://wpgeodirectory.com/support/topic/membership-level-restrictions/#post-27104 <![CDATA[Reply To: Membership Level Restrictions]]> https://wpgeodirectory.com/support/topic/membership-level-restrictions/#post-27104 Mon, 12 Jan 2015 12:07:56 +0000 Ian Butler That is an option and it would stop certain users adding listings, however I’d rather not give the impression that it’s possible to add listings.

This might be annoying for the user.

I would much prefer to display the widget conditionally if this is possible.

]]>
https://wpgeodirectory.com/support/topic/membership-level-restrictions/#post-27109 <![CDATA[Reply To: Membership Level Restrictions]]> https://wpgeodirectory.com/support/topic/membership-level-restrictions/#post-27109 Mon, 12 Jan 2015 12:26:22 +0000 Ian Butler I suppose I could remove the widget completely from the BuddyPress pages and create a set of similar pages for business owners with the widget included, and make these restricted…. Just seems a cumbersome approach.

Let me know if you can think of a way I can avoid doing this.

Thanks again.

]]>
https://wpgeodirectory.com/support/topic/membership-level-restrictions/#post-27113 <![CDATA[Reply To: Membership Level Restrictions]]> https://wpgeodirectory.com/support/topic/membership-level-restrictions/#post-27113 Mon, 12 Jan 2015 12:41:10 +0000 Ian Butler Okay on line 359 of geodirectory_widgets.php I have replaced with:

if (current_user_is(‘s2member_level1’)) { register_widget(‘geodir_loginwidget’); }

This works and now only shows the widget conditionally.

Can you foresee any problems with doing this?

Thanks

]]>
https://wpgeodirectory.com/support/topic/membership-level-restrictions/#post-27125 <![CDATA[Reply To: Membership Level Restrictions]]> https://wpgeodirectory.com/support/topic/membership-level-restrictions/#post-27125 Mon, 12 Jan 2015 14:21:26 +0000 Stiofan O'Connor If it were me i would simply copy the widget code into your child theme functions and rename it to your own, then add the conditional call around that, this will mean it won’t be overwritten on updates.

Thanks,

Stiofan

]]>
https://wpgeodirectory.com/support/topic/membership-level-restrictions/#post-27129 <![CDATA[Reply To: Membership Level Restrictions]]> https://wpgeodirectory.com/support/topic/membership-level-restrictions/#post-27129 Mon, 12 Jan 2015 14:41:55 +0000 Ian Butler That’s a far cleaner solution – thanks for your help!

]]>