Skip to content

Instantly share code, notes, and snippets.

@danbp
Created August 23, 2016 17:29
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danbp/ea92923b1109ee1fcebd0741d861cda6 to your computer and use it in GitHub Desktop.
Save danbp/ea92923b1109ee1fcebd0741d861cda6 to your computer and use it in GitHub Desktop.
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

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

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