Skip to:
Content
Pages
Categories
Search
Top
Bottom

Add some page to Profile


  • Gromozeka
    Participant

    @gromozeka

    Hello!
    I want to add an email preferences page to a members profile. How can i do this? Do i need to create a new component for this?

Viewing 2 replies - 1 through 2 (of 2 total)

  • Henry Wright
    Moderator

    @henrywright

    Hi @gromozeka

    You could create a new component but that isn’t required. Check out bp_core_new_nav_item() for how to add items to the navigation.

    bp_core_new_nav_item()


    Gromozeka
    Participant

    @gromozeka

    Thank. I did added custom menu item. But i try load custom template when open ,y custom page on member profile. I use this code

    function bp_gf_ua_profile_nav_add()
    {
        bp_core_new_nav_item(
            array(
                'name' => __('Email preferences', 'buddypress'),
                'slug' => 'email-preferences',
                'position' => 3,
                'show_for_displayed_user' => true,
                'screen_function' => 'bp_gf_ua_profile_load_template',
                'item_css_id' => 'all-conversations'
            )
        );
    }
    
    function mb_show_posts2() {
        echo "Test Text";
    }
    
    function bp_gf_ua_profile_load_template()
    {
        add_action( 'bp_template_content', 'mb_show_posts2' );
        bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/email-preferences/preferences' ));
    }
    
    add_action( 'bp_setup_nav', 'bp_gf_ua_profile_nav_add' );

    But always display memeber-loop template. What i doing wrong?

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add some page to Profile’ is closed to new replies.
Skip to toolbar