If you remove settings tab it auto removes all child pages.
function w24dr_remove_settings_nav() {
bp_core_remove_nav_item( bp_settings_slug() );
}
add_action( 'bp_setup_nav', 'w24dr_remove_settings_nav' );
Hi there ,
Thanks for your response, I tried your function, but without success, I try this function which I found on internet
function my_remove_em_nav() {
global $bp;
bp_core_remove_nav_item( 'settings' );
}
add_action( 'bp_init', 'my_remove_em_nav' );
Thanks
If you are on latest version of buddypress( > 2.6 ), the following code will work:
//hide setting nav in profile
function w24dr_remove_settings_nav() {
$bp = buddypress();
$bp->members->nav->delete_nav( bp_get_settings_slug() );
}
add_action( 'bp_setup_nav', 'w24dr_remove_settings_nav' );
//redirect settings to main profile page
function w24dr_redirect_settings_nav(){
if( bp_is_user() && bp_is_current_component( bp_get_settings_slug() ) ){
wp_redirect( bp_displayed_user_domain() );
exit();
}
}
add_action( 'template_redirect', 'w24dr_redirect_settings_nav' );
But it still doesn’t remove ‘settings’ nav from adminbar. You need to work some more to remove it from there.