Skip to:
Content
Pages
Categories
Search
Top
Bottom

Tab on Own Profile Only


  • phos flip
    Participant

    @wamoma

    Hello = trying to add a tab that will show to the logged in user on their profile only. Have used the bp_is_my_profile() as below but the tab still shows to all users on all profiles. Can anybody point out what I’ve done wrong?


    function bp_content_setup_nav() {
    global $bp;
    bp_core_new_nav_item( array(
    'user_has_access' => ( bp_is_my_profile() || is_super_admin() ),
    'name' => __('Add a Story', 'buddypress'),
    'slug' => 'add-story',
    'screen_function' => 'add_story_screen_link',
    'position' => 40,
    'default_subnav_slug' => 'add-story-subnav'
    ) );

    do_action( 'bp_content_setup_nav' );
    }
    add_action( 'bp_setup_nav', 'bp_content_setup_nav' );

    function add_story_screen_link() {
    add_action( 'bp_template_title', 'add_story_screen_title' );
    add_action( 'bp_template_content', 'add_story_screen_content' );
    bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );
    }

    function add_story_screen_title() {
    echo 'Add Story';
    }

    function add_story_screen_content() {
    get_template_part( 'content-addstorybuddypress' );
    }

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Tab on Own Profile Only’ is closed to new replies.
Skip to toolbar