This topic has 3 replies, 2 voices, and was last updated 9 years by agolden42.

  • Author
  • #51860
     agolden42
    Participant

    Sorry if this has been asked before, but I didn’t see this specific question in my searches of the forum. I’m using BuddyPress and Paid Memberships Pro. I’d like to hide the “Create a Group” link from specific membership levels. Any guidance would be appreciated.

    #51885
     sharmstr
    Moderator

    The best place for answers about PMPro is PMPro not here. With that said, google pmpro_hasMembershipLevel(). That’s the function you’ll need to use to check the membership level of the current user. There’s the bp_get_group_create_nav_item filter you can tap into. If you have questions about that, you should ask over on the buddypress forums.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #51886
     sharmstr
    Moderator

    Here’s some pseudo code that’s off the top of my head, so not guaranteed to work but should give you an idea on how to do it.

    COPY CODE
    
    add_filter( 'bp_get_group_create_nav_item ', 'can_create_group' );
    function can_create_group() {
    if !pmpro_hasMembershipLevel() {
    return;
    }
    $create_group_button = bp_get_group_create_button();
    // Make sure the button is available
    if ( empty( $create_group_button ) ) {
    return;
    }
    $output = '<li id="group-create-nav">' . $create_group_button . '</li>';
    return $output;
    }
    
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #51903
     agolden42
    Participant

    Thanks, sharmstr! Much appreciated.

Viewing 4 posts - 1 through 4 (of 4 total)

The forum ‘KLEO’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?