• Hi,
    i need help with my code.
    I created submenu in buddypress (Friends -> Send Invites).
    Everything is o.k., just link to the new page is not correct (https://cveko.si/invite-anyone/), it should be (https://cveko.si/members/samo/invite-anyone/)

    How do I fix this?
    Thanks

    The code is below:

    add_action( 'bp_setup_nav', 'add_invite_subnav_tab', 100 );
    function add_invite_subnav_tab() {
    	global $bp;
    
    	bp_core_new_subnav_item( array(
    		'name' => 'Send invites',
    		'slug' => 'invite-anyone',
    		'parent_url' => trailingslashit( bp_loggedin_user_domain() . 'friends' ),
    		'parent_slug' => 'friends',
    		'screen_function' => 'profile_screen_invite',
    		'position' => 50
    				)
    	);
    }
    // redirect to videos page when 'Videos' tab is clicked
    // assumes that the slug for your Videos page is 'videos'
    function profile_screen_invite() {
    	bp_core_redirect( get_option('siteurl') . "/invite-anyone/" );
    }
  • The topic ‘Buddypress submenu link’ is closed to new replies.