This topic has 10 replies, 3 voices, and was last updated 8 years by Radu.

  • Author
  • #183200
     graphite
    Participant

    Hi,

    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 🙂

    #183251
     Kieran_SQ
    Moderator

    Hi,

    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 solution
    #183267
     graphite
    Participant

    datingyo.com
    admina
    SQu)WS@Rtdj9qZ7CbTs#$E5t

    I 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!

    #183277
     Kieran_SQ
    Moderator

    Hi,

    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 CODE
    li#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 solution
    #183359
     graphite
    Participant

    Hi 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%

    #183420
     Kieran_SQ
    Moderator

    Hi,

    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 solution
    #183563
     graphite
    Participant

    Thank you Kieran!

    Looking forward to receiving the reply 🙂

    #183614
     Radu
    Moderator

    Hi,

    The problem it’s because of this rule from the style.css

    COPY CODE
    
    
    li#group-create-nav {
        display: none !important;
    }
    
    

    You will have to remove the important, so the code will be

    COPY CODE
    
    
    li#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 solution
    #183658
     graphite
    Participant

    It works now, thank you Radu.
    Merry Christmas 🙂

    #183666
     graphite
    Participant

    For 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 } ?>

    #183693
     Radu
    Moderator

    Hi,

    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
Viewing 11 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic.

Log in with your credentials

Forgot your details?