Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: How do I add a menu item on the profile page?


Virtuali
Participant

@gunju2221

Try:

`bp_core_new_subnav_item( array(
‘name’ => ‘My New Page’,
‘slug’ => ‘my-new-page’,
‘parent_url’ => $bp->loggedin_user->domain . $bp->members->slug . ‘/’,
‘parent_slug’ => $bp->members->slug,
‘screen_function’ => ‘my_members_page_function_to_show_screen’,
‘position’ => 40 ) );`
You can change the slug and name by the “slug” => and ‘name’ =>

Then the screen function

`function my_members_page_function_to_show_screen() {

//add title and content here – last is to call the members plugin.php template
add_action( ‘bp_template_title’, ‘my_members_page_function_to_show_screen_title’ );
add_action( ‘bp_template_content’, ‘my_members_page_function_to_show_screen_content’ );
bp_core_load_template( apply_filters( ‘bp_core_template_plugin’, ‘members/single/plugins’ ) );
}

function my_members_page_function_to_show_screen_title() {
echo ‘My Page Title’;
}
function my_members_page_function_to_show_screen_content() {

// page content goes here

}`

Not tested.

Skip to toolbar