-
Author
-
May 14, 2015 at 08:41 #58718contemplateParticipant
I have PmPro installed with 3 membership levels. I want all BuddyPress functionality restricted to only one of the levels. When I go to Theme Options -> Memberships and select all levels except the one that should have access it doesn’t work. I’ve tried doing the reverse as well and nothing. I have a test user who has one of the levels which does NOT grant access to Buddypress but he can see everything… groups, members, etc. See screenshot.
I did read in another thread that the PMPRo Registration Helper is causing issues with this theme. I deactivated that plugin and resaved the Theme Options but it still doesn’t work.
Attachments:
You must be logged in to view attached files.May 14, 2015 at 16:15 #58751sharmstrModeratorRespond privately with a link and admin credentials
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
May 14, 2015 at 17:19 #58758sharmstrModeratorI’ve done some testing and I cant recreate your issues on my test site. So, its either a plugin conflict or the custom PMPro functions in your functions.php file.
A quick way to test if its something you added to your functions.php file is to enable the parent Kleo theme. Before doing that, export your theme options settings so you can reimport them in the kleo parent. Or if you dont want to do that, just do a quick test and restrict the groups directory.
Obviously testing for plugin conflicts means disabling all the extra plugins you have. And since we are on the subject, I strongly suggest that you dont use bp like. Clicking like spawns several ajax calls. Click another like doubles it. Clicking another like triples it and so on. Bring up the page inspector and go to the network tab. Click a like. Then click unlike. You’ll see what I mean.
Make sure you empty all your caches all well.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
May 14, 2015 at 17:24 #58759sharmstrModeratorI was just looking through your custom functions again and I dont really see anything that would cause this. Its all pretty generic stuff. So, if I were you, I’d go with the plugin route first.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
May 14, 2015 at 18:07 #58770sharmstrModeratorI just tested having the levels page as your home page and that’s not the issue either.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
May 14, 2015 at 18:13 #58771sharmstrModeratorThe only plugin that I see that’s out of date is Visual Composer. You should upgrade that. It probably wont fix your issues, but there are problems with it for sure. https://archived.seventhqueen.com/forums/topic/steps-to-update-kleo-theme
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
May 14, 2015 at 18:33 #58774contemplateParticipantThanks for the tip about BP Like.
So I commented out all my custom functions. Disabled all the plugins except for PMPro & BuddyPress. I cleared the Object Cache. But it’s still doing the same thing π
May 14, 2015 at 18:57 #58780sharmstrModeratorHmmm. I’v been testing different settings and I cant get it to NOT work. I was keeping an eye on what you were doing and it didnt appear that you disabled ALL plugins. Looked like you still had some BP plugins enabled.
You can try adding custom functions to do it for you instead of relying on Kleo I suppose. I’ve tested this code on my site, so I know it works. What it does is redirects you to the home page (your levels page) if anyone besides level 3 tries to view a profile that’s not theirs. Put it your functions file and turn off profile blocking in theme options > memberships before testing it. Again, you might have to clear your cache as well.
COPY CODEfunction custom_deny_access() { if ( bp_is_member() && !bp_is_my_profile() && !pmpro_hasMembershipLevel(3) ) { wp_redirect( get_bloginfo( 'url' ) ); } } add_action( 'template_redirect', 'custom_deny_access' );
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
May 14, 2015 at 19:26 #58781contemplateParticipantThanks for the code. So I turned off the restrictions in Theme Options -> Memberships. I inserted the code into functions.php and changed the level to “2” which should be the only level which has access. I also disabled the PMPro Registration Helper and cleared caches. It still didn’t work π
It’s odd because regular page restrictions are working fine. It’s just the BuddyPress directories aren’t being restricted. Logins are the same. Thanks for any help in looking into this.
May 14, 2015 at 19:33 #58786sharmstrModeratorThen it has to be a plugin issue or similar. You just took Kleo out of the picture by adding the custom code. You didnt say if you tested with ALL plugins disabled or not, meaning all the extra buddyrpess plugins. And for my sanity, please update VC. It has real issues with WP 4.2+
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
May 14, 2015 at 19:50 #58788contemplateParticipantOk I’ve updated VC. I then disabled everything except Buddypress & PMPro. I commented out all the functions except the one above. I cleared all caches. I re-saved Theme Options. I tried a different browser. Still no difference ?!? I’m totally at a loss here.
If you want to check it out I’ll keep it all disabled for the next 10 minutes.
May 14, 2015 at 20:03 #58791contemplateParticipantOk I re-enabled the coming soon page but the rest is disabled.
May 14, 2015 at 20:22 #58792sharmstrModeratorIts working for me on your site. I’ve enabled a few plugins and its still working. You should go through and enable one by one until you find the one that breaks the site.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
May 14, 2015 at 20:26 #58794contemplateParticipantOk it seems to be partially working in not letting me open a member’s profile. But I can still get into the members directory, group directory, individual groups, etc..
May 14, 2015 at 20:31 #58797sharmstrModeratorI know.
What it does is redirects you to the home page (your levels page) if anyone besides level 3 tries to view a profile thatβs not theirs.
Baby steps. We are trying to ID the issue.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
May 14, 2015 at 20:40 #58798contemplateParticipantah yes! Sorry I didn’t ready careful enough. Do you want me to continue to enable plugins? Or are you still working on it? Thanks for your help!
May 14, 2015 at 20:42 #58799sharmstrModeratorStart enabling them. We are trying to find the issue (conflict). LOL
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
May 14, 2015 at 20:47 #58800sharmstrModeratorAlso, can I have ftp access to your site? Respond privately. I want to check out a few Kleo files.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
May 14, 2015 at 20:56 #58801contemplateParticipantOK so most likely I was just testing the custom function wrong. All plugins are enabled & all functions re-enabled and the custom function works. So maybe it is a Kleo conflict.
FTP to follow.
May 14, 2015 at 21:08 #58804sharmstrModeratorOkay. Give me some time. I have my real job to attend to for a bit. (I dont work here, in case you didnt know)
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
May 14, 2015 at 21:09 #58805sharmstrModeratorWell, let me clarify, I sorta work here. I didnt want to freak you out thinking you just gave the keys to the kingdom to some random person π
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
May 14, 2015 at 22:06 #58809sharmstrModeratorIf you see some whacky stuff, its me π
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
May 14, 2015 at 23:12 #58812sharmstrModeratorWow that took forever. I cant determine whats wrong. But this should get you close. I didnt want to add it because you’ll have to make sure your admin(s) are in the correct level. Also, change the 1 to whatever level its supposed to be. The code is from my site so I used 1. I purposely put each component in its own if statement so you can easily see what they do and disable/change if necessary.
COPY CODEfunction custom_deny_access() { global $bp; if ( bp_is_user() && !bp_is_my_profile() && !pmpro_hasMembershipLevel(1) ) { wp_redirect( get_bloginfo( 'url' ) ); exit; } if ( bp_is_activity_directory() && !pmpro_hasMembershipLevel(1) ) { wp_redirect( get_bloginfo( 'url' ) ); exit; } if ( bp_is_members_directory() && !pmpro_hasMembershipLevel(1) ) { wp_redirect( get_bloginfo( 'url' ) ); exit; } if ( bp_is_group() && !pmpro_hasMembershipLevel(1) ) { wp_redirect( get_bloginfo( 'url' ) ); exit; } if ( bp_is_groups_directory() && !pmpro_hasMembershipLevel(1) ) { wp_redirect( get_bloginfo( 'url' ) ); exit; } if ( bp_is_messages_compose_screen() && !pmpro_hasMembershipLevel(1) ) { wp_redirect( get_bloginfo( 'url' ) ); exit; } } add_action( 'template_redirect', 'custom_deny_access' );
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
May 15, 2015 at 00:03 #58821sharmstrModeratorHow’s it looking over there?
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
May 15, 2015 at 00:32 #58826sharmstrModeratorSweet. Good luck with the launch.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
-
AuthorPosts
The forum ‘KLEO’ is closed to new topics and replies.