Hide Listings on BuddyPress Pages and Menu

M2Pro limits access to Listings pages and menu by Membership Level, but BuddyPress allows all members to View *My Listings* and *Add Listings* from the BuddyPress pages and menu. I am trying to set up Member Levels to function like this:
* VIP: Add ProSites sub-site (site1.americansoccer.tv), Directory (Add Listing, View My Listings), publish blog posts on main site, private forums
* Pro: Add ProSites sub-site (site1.americansoccer.tv), Directory (Add Listing, View My Listings)
* Basic: Add ProSites sub-site (site1.americansoccer.tv)

  • Vaughan

    Hi Daniel,

    Hope you're well?

    Is this using the directory plugin?

    You can set permissions based on role in the directory settings capabilities.

    I suppose with this, if you enable the member capabilities add-on in membership 2, you can assign a role for each membership level. So using a plugin such as user role editor to create a custom role, you could actually assign that custom role & set the capabilities of that role then in the user role editor plugin. then have membership 2 assign that role to the members in that plan.

    https://wordpress.org/plugins/user-role-editor/

    So once you have the capabilities add-on enabled in membership 2.

    you will see a new menu item for user roles on the protection rules settings page.

    So assign a role to a specific membership. Either an existing rule, or a custom role that you created with user role editor.

    Now in Directory settings, you should be able to assign the capabilities for that user role & any members on that plan will inherit that user roles capabilities.

    Hope this helps

  • Vaughan

    Hi Daniel,

    Apologies for the delay on this.

    I've been looking at this, but I think it would require some custom code.

    If I understand correctly, you don't want the basic plan to allow access to directory in BP.

    Can you try this;

    download the attached buddypress.php.zip

    Now, unzip this file to your desktop.

    Open up the file.

    Find the following on line 59

    $membership_id = 100;

    Replace 100 with the membership ID of your basic membership plan.

    you can find the ID on the Dashboard > membership > memberships

    click the shortcodes and it should show you the ID.

    Now save the file.

    Once done, upload this file to the following location (making sure to overwrite the existing file)

    /wp-content/plugins/directory/core/buddypress.php

    Hopefully now you shouldn't see those menu items in the BP pages for members in the basic plan.

    Hope this helps

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.