Documentation for this is in bp-core-buddybar.php
Some working examples for navigation (since 2.6) here.
And here a working example for:
-
remove Delete Account on user profile settings tab
-
add a new sub-nav item for “Memberships” to Profile > Settings
1 )
function bpex_remove_profile_settings_sub_tab() {
// remove Delete Account from Profile Settings
bp_core_remove_subnav_item( BP_SETTINGS_SLUG, 'delete-account' );
}
add_action( 'bp_actions', 'bpex_remove_profile_settings_sub_tab' );
2 )
function bpex_add_sub_nav_to_profile_settings() {
global $bp;
$parent_slug = 'settings';
$child_slug = 'memberships';
//Add subnav item
bp_core_new_subnav_item( array(
'name' => __( 'My Memberships', 'textdomain' ),
'slug' => $child_slug,
'parent_url' => $bp->loggedin_user->domain . $parent_slug.'/',
'parent_slug' => $parent_slug,
'screen_function' => 'bpex_profile_membership_screen'
) );
}
function bpex_profile_membership_screen() {
add_action( 'bp_template_content', 'bpex_profile_membership_screen_content' );
bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );
}
function bpex_profile_membership_screen_content() {
do_action( 'my_membership_post' );
}
add_action( 'bp_setup_nav', 'bpex_add_sub_nav_to_profile_settings', 100 );
function bpex_membership_stuff() {
echo 'Some stuff here ?'; ?>
<h2>Lorem Ipsum for ever !</h2>
<p>Aenean suscipit nulla in justo. Suspendisse cursus rutrum augue. Nulla tincidunt tincidunt mi. Curabitur iaculis, lorem vel rhoncus faucibus, felis magna fermentum augue, et ultricies lacus lorem varius purus. Curabitur eu amet.</p>
<?php
}
add_action( 'my_membership_post', 'bpex_membership_stuff' );
Add this to bp-custom.php
Hi @danbp,
Thanks for you reply, I’ll try this and I’ll get back to you with the results.
I really appreciate your help.
Thanks,
John
Thanks @danbp, RIHANNA TOLD ME THIS WORK WORK WORK WORK WORK!
I express gratitude for your help! 🙂