Skip to:
Content
Pages
Categories
Search
Top
Bottom

s2member hide tabs

  • Profile photo of buckyb
    buckyb
    Participant

    @buckybeever

    Hello, wondering how to restrict access to a custom tab/page I made using s2member?

    This is what I’ve placed in my functions, and not sure how to go forward…

    Also dont wont to use the custom capabilities from s2member alone with this really want to hide the tab that shows up so that say s2member_level2 can only see this page, and no one above or below that can see it either.

    function profile_new_nav_item() {

    global $bp;

    bp_core_new_nav_item(
    array(
    ‘name’ => ‘My Tab’,
    ‘slug’ => ‘mytab’,
    ‘default_subnav_slug’ => ‘mytab_sub_tab’,
    ‘position’ => 5,
    ‘screen_function’ => ‘view_manage_tab_main’
    )
    );
    }

    add_action( ‘bp_setup_nav’, ‘profile_new_nav_item’, 5 );

    function view_manage_tab_main() {
    add_action( ‘bp_template_content’, ‘bp_template_content_main_function’ );
    bp_get_template_part( ‘members/single/plugins’ );
    }

    function bp_template_content_main_function() {
    if ( ! is_user_logged_in() ) {
    wp_login_form( array( ‘echo’ => true ) );

    } else {
    echo do_shortcode( ‘[table id=1 /]’ );
    }
    }

    If anyone could explain would greatly appreciate it!!

  • You must be logged in to reply to this topic.
Skip to toolbar