Skip to:
Content
Pages
Categories
Search
Top
Bottom

Navigation API – Default Slug?


  • Andrew Tegenkamp
    Participant

    @andrewteg

    I’m trying to edit my user’s profile so that when they click on “Settings” they go to the “Email” (/settings/notifications/) by default. I found https://codex.buddypress.org/developer/navigation-api/ and am trying to apply that to the default_subnav_slug but must be missing something. Any ideas?

    
    add_action( 'bp_setup_nav', 'bp_edit_subnav_default');
    function bp_edit_subnav_default($data) {
    	global $bp;
    	$new_data = array(
    		'screen_function'     => 'bp_settings_screen_notifications',
    		'default_subnav_slug' => 'notifications',
    	);
    	$bp->members->nav->edit_nav($new_data, 'settings');
    
    }
    
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar