Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
BuddyPress Move Profile Edit edit tab to Profile Settings tab
/* This goes to child-theme style.css and will hide the Profile Edit button. */
#edit-personal-li {
display:none!important;
}
*/ And this is to put into bp-custom.php to get the Edit button on the Profile Settings subnav.
Note that there is an array field containing a new css rule for the item. */
function bpex_move_profile_edit_tab() {
if( bp_is_active( 'xprofile' ) ) :
// add Profile Edit to Settings
bp_core_new_subnav_item( array(
'name' => __( 'Edit Profile', 'text-domain' ),
'slug' => 'edit',
'parent_url' => trailingslashit( bp_loggedin_user_domain() . bp_get_profile_slug() ),
'parent_slug' => bp_get_settings_slug(),
'screen_function' => 'xprofile_screen_edit_profile',
'item_css_id' => 'settings-profile', // ID must be unique
'position' => 20,
'user_has_access' => bp_is_my_profile() // Only the logged in user can access this on his/her profile ), 'members' );
endif;
}
add_action( 'bp_setup_nav', 'bpex_move_profile_edit_tab' );
@meestergijs
Copy link

meestergijs commented Aug 6, 2019

The code gives me the error that line 25 (endif;) is not correct.. How come?

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment