Group Mods

  • Profile picture of @mercime
  • Profile picture of r-a-y
  • Profile picture of Hugo

Changing default tab in the settings menu (4 posts)

Started 1 year, 1 month ago by: Roger Coathup

  • Profile picture of Roger Coathup Roger Coathup said 1 year, 1 month ago:

    Can’t get bp_core_new_nav_default() function to work for the settings menu. Any thoughts would be appreciated.

    ———–

    I’ve tried using the bp_core_new_nav_default() function to change the default tab in settings to notifications, but it doesn’t appear to have any effect on the menu:

    function settings_default_subnav() {
    global $bp;

    bp_core_new_nav_default ( array( ‘subnav_slug’ => ‘notifications’, ‘parent_slug’ => $bp->settings->slug, ‘screen_function’ => ‘bp_core_screen_notification_settings’ ) );
    }

    add_action( ‘bp_setup_nav’, ‘settings_default_subnav’);

    Any thoughts on why this wouldn’t work?

    Notes:
    We tried this with various priority settings, and in both bp-custom.php and functions.php – but it just seems to be ignored.
    Is bp_setup_nav the right action to hook onto?

  • Profile picture of @mercime @mercime said 1 year, 1 month ago:

    @rogercoathup http://trac.buddypress.org/browser/tags/1.2.8/bp-core/bp-core-settings.php

    the bad way – change 'position' => 20, to 'position' => 10, and vise versa in core lines 21 and 22 :-)

    or an easy way

    `remove_action( ‘bp_setup_nav’, ‘bp_core_add_settings_nav’ );

    add_action( ‘bp_setup_nav’, ‘bp_core_roger_settings_nav’ );
    funtion bp_core_roger_settings_nav() {
    global $bp;
    // the stuff
    }

    looking for the best way

  • Profile picture of Roger Coathup Roger Coathup said 1 year, 1 month ago:

    @mercime – yes, we had already had to adopt the solution of writing our own version of bp_core_add_settings_nav() – similarly to your suggestion.

    Unfortunately, this doesn’t answer why bp_core_new_nav_default() doesn’t work with the settings menu.

  • Profile picture of Dave Konopka Dave Konopka said 9 months, 1 week ago:

    I ran into this same issue trying to default the Settings nav entry to the Notifications subnav. Seems like a bug.