Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: How to modify bp_get_options_nav()?

@danielengelhardt

Participant

In case someone else wants to send users straight to the edit-page when clicking on “profile”-link, i got to manage it this way:
(THIS HAS TO BE DONE IN wp-content/plugins/bp-custom.php, NOT IN YOUR CHILD THEMES functions.php)

function my_change_profile_default_subnav() {
  global $bp;
  if (bp_is_my_profile()) {
    bp_core_new_nav_default(array( 'parent_slug' => $bp->profile->slug, 'screen_function' => "xprofile_screen_edit_profile", 'subnav_slug' => $bp->profile->edit->slug));
  }
}
add_action( 'bp_setup_nav', 'my_change_profile_default_subnav' );

What helped me a lot was to temporarily put this snippet into my functions.php:

function bp_dump() {
    global $bp;
 
    foreach ( $bp as $key => $value ) {
        echo '<pre>';
        echo '<strong>;' . $key . ': </strong><br />';
        print_r( $value );
        echo '</pre>';
    }
    die;
}
add_action( 'wp', 'bp_dump' );

It gives you all the slugs, screen-functions, css-ids and all that good-to-know-stuff.

Hope this helps 😉

Skip to toolbar