-
Author
-
December 16, 2017 at 02:46 #183200
graphite
ParticipantHi,
Can I prevent certain pmpro levels from creating a Buddypress group?
The old code seems not working:
header.php <?php if ( pmpro_hasMembershipLevel(array(2,3))) { ?> <style> form#groups-directory-form .button:nth-child(2n) { display: initial !important; } </style> <?php } ?>
style.css form#groups-directory-form .button:nth-child(2n) { display: none !important; }
Thank you 🙂
December 16, 2017 at 19:04 #183251Kieran_SQ
ModeratorHi,
Thanks for reaching out, can you please update this ticket with some admin credentials so I can have a look at both the front and back end.
Thanks,
Kieran
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionDecember 17, 2017 at 04:31 #183267graphite
Participantdatingyo.com
admina
SQu)WS@Rtdj9qZ7CbTs#$E5tI don’t want the membership level 1 (Love) to “create” a group of Buddypress on the page: https://www.datingyo.com/groups/ (they should not see “Create a Group” link)
If other methods can have the same result, it would be also great.Please let me know if there is any change made on the website, thank you!
December 17, 2017 at 16:23 #183277Kieran_SQ
ModeratorHi,
Please can you test the change I just made with an admin account and a standard user with the membership level that should not see the create group button.
I changed the PHP used in the header.php file to
COPY CODE<?php if ( pmpro_hasMembershipLevel(array(2,3))) { ?> <style> li#group-create-nav { display: initial !important; } </style> <?php } ?>I also changed the CSS used in style.css to
COPY CODEli#group-create-nav { display: none !important; }If you are caching for logged in users please make sure to clear your website cache and local cache (Ctrl+F5) when you log out of X account to switch to the other.
Thanks,
Kieran.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionDecember 18, 2017 at 01:13 #183359graphite
ParticipantHi Kieran,
Thank you for the reply. But it still has some problem.It successfully block out membership level 1, but Membership level 2 or 3 cannot see the link.
You can use the a demo member (membership level 2) to test
nicole
QZ0ugGxCShvP1XPYtG)K6lV%December 18, 2017 at 20:22 #183420Kieran_SQ
ModeratorHi,
I will refer this ticket to a developer for review as it doesn’t seem to working with a CSS rule for unset. They’ll be in touch with you as soon as they can, Monday to Friday, East Europe Time.
Thank you for your patience,
Kieran
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionDecember 20, 2017 at 23:55 #183563graphite
ParticipantThank you Kieran!
Looking forward to receiving the reply 🙂
December 21, 2017 at 16:48 #183614Radu
ModeratorHi,
The problem it’s because of this rule from the style.css
COPY CODEli#group-create-nav { display: none !important; }You will have to remove the important, so the code will be
COPY CODEli#group-create-nav { display: none; }Let me know
Cheers
R.Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionDecember 22, 2017 at 00:37 #183658graphite
ParticipantIt works now, thank you Radu.
Merry Christmas 🙂December 22, 2017 at 04:10 #183666graphite
ParticipantFor the record, it uses following on function.php:
<?php if ( pmpro_hasMembershipLevel(array(2,3))) { ?>
<style>
li#group-create-nav {
display: unset !important;
}
</style>
<?php } ?>December 22, 2017 at 16:12 #183693Radu
ModeratorHi,
Merry Christmass!
Great if it works
Cheers
R.Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution -
AuthorPosts
You must be logged in to reply to this topic.