Tagged: mediapress sitewide
On our site we would like to exclude certain members from having their galleries shown on the sitewide galleries page. Certainly their membership level would be one criterion for example. Could you suggest the best way to add this code please?
Hi Geoff,
Thank you for the question.We can do it by hooking to
mpp_before_gallery_query
. before I assist, i have a few questions:-1. Do you want to exclude from Sitewide gallery(non related to BuddyPress) or do you want to do it for BuddyPress gallery directory?
2. What is the plugin that you are using for membership level? Can you give me an example(e.g Users with membership level x should not have their gallery visible)
3. Do you want it for gallery and media both or just gallery?
Please share the details and I will assist.
Regards
BrajeshHi Brajesh,
Thank you very much for your reply.
1. We want to exclude only for the BuddyPress gallery directory.
2. We are using Paid Memberships Pro and everyone has a membership level either Basic or Silver. We want to exclude Basic members, I think they are level 1.
3. We want to exclude both galleries and media.
Be grateful for your guidance, thanks.
Regards,
GeoffHi Geoff,
Thank you for sharing the details.Please allow me to get back to you in next 24 hours.
Regards
BrajeshHi Geoff,
Hope you are doing well.Thank you for your patience.
I am sorry, It took me a little longer. I had not recently used Paid Membership Pro and had trouble finding all users with a specific subscription level. Based on their table, I have written a function(Please test it if it is working or not) to achieve this.
https://pastebin.com/raw/aAc8sm0V
Please put it in bp-custom.php and It will hide galleries from all users with “Basic” membership level.
Let me know if it works or not?
Regards
BrajeshPS:- I have updated the link with correct code.
- This reply was modified 1 week, 1 day ago by
Brajesh Singh.
- This reply was modified 1 week, 1 day ago by
Hi,
I had a small issue with the old code. Have updated the link with correct code. Please use the code from the new link.Regards
BrajeshHi,
Thank you very much indeed, it workd perfectly! One thing I didn’t consider though, when you search the sitewide gallery Basic members galleries are still included and can be viewed. Would there be a way of omitting them?Regards,
GeoffThank you Geoff.
I am glad it worked.Please allow me to look into it and share the updated code today.
I am assuming by sitewide gallery search you are referring to the search form in the BuddyPress gallery directory.
Regards
BrajeshYes the search form in the Buddypress gallery directory. It would be great to be able exclude by membership level, thanks.
You must be logged in to reply to this topic.