Support » Plugin: Custom Profile Menu for BuddyPress » Making Menu with BuddyPress function bp_nav_menu()

  • in my child theme I have added this to the members/single/parts/item-nav
    <label class=”toggle” for=”toggle”>☰ <span>Menu</span></label>
    <input class=”toggle” id=”toggle” type=”checkbox”>

    <nav class="<?php bp_nouveau_single_item_nav_classes(); ?>" id="object-nav" role="navigation" aria-label="<?php esc_attr_e( 'Member menu', 'buddypress' ); ?>">
    	<?php if ( bp_nouveau_has_nav( array( 'type' => 'primary' ) ) ) : ?> 
    		<ul>
       <?php bp_nav_menu(); ?> 
    		</ul>
    	<?php endif; ?>
    </nav>

    This is a Buddypress code that rewrites the menu. But with your plugin activated many ( not all ) sub items are duplicated.

    It seems to be related to the Custom Profile Menu for BuddyPress Plugin by If I disable the plug in it works fine
    So this is the problem (the b is not affected by activating you plugin)

    1. The loop for the sub-menus is
    a. Duplicating many (activity, notifications, messages are fine. See setting, groups, friends …)

    Looking at the documentation for bp_nav_menu() there is an argument for walker that there is no documentation I could find.
    Could that help solve this or is it something else.

    Here are the two source codes for the generated menus one while looking at another member not as admin
    and the other looking at my own profile.

    Looking at another Member

    <nav class="main-navs no-ajax bp-navs single-screen-navs user-nav-tabs tabbed-links horizontal users-nav" id="object-nav" role="navigation" aria-label="Member menu">	  
    		<ul>
       <div class="menu-bp-container"><ul id="menu-bp" class="menu"><li id="front-personal-li" class="menu-parent"><a href="https://DOMAIN.org/members/wvanvark/front/#item-header-content">Home</a>
    <ul class="sub-menu">
    	<li id="public-personal-li" class="menu-child"><a href="https://DOMAIN.org/members/wvanvark/front/#item-header-content">View</a></li>
    </ul>
    </li>
    <li id="xprofile-personal-li" class="menu-parent current-menu-parent"><a href="https://DOMAIN.org/members/wvanvark/profile/#item-header-content">Profile</a></li>
    <li id="products-personal-li" class="menu-parent"><a href="https://DOMAIN.org/members/wvanvark/products/#item-header-content">Products</a></li>
    <li id="activity-personal-li" class="menu-parent"><a href="https://DOMAIN.org/members/wvanvark/activity/#item-header-content">Activity</a>
    <ul class="sub-menu">
    	<li id="just-me-personal-li" class="menu-child"><a href="https://DOMAIN.org/members/wvanvark/activity/#item-header-content">Personal</a></li>
    	<li id="activity-mentions-personal-li" class="menu-child"><a href="https://DOMAIN.org/members/wvanvark/activity/mentions/#item-header-content">Mentions</a></li>
    	<li id="activity-favs-personal-li" class="menu-child"><a href="https://DOMAIN.org/members/wvanvark/activity/favorites/#item-header-content">Favorites</a></li>
    	<li id="activity-friends-personal-li" class="menu-child"><a href="https://DOMAIN.org/members/wvanvark/activity/friends/#item-header-content">Friends</a></li>
    	<li id="activity-groups-personal-li" class="menu-child"><a href="https://DOMAIN.org/members/wvanvark/activity/groups/#item-header-content">Groups</a></li>
    </ul>
    </li>
    <li id="friends-personal-li" class="menu-parent"><a href="https://DOMAIN.org/members/wvanvark/friends/#item-header-content">Friends <span class="count" style="cursor: pointer;">1</span></a>
    <ul class="sub-menu">
    	<li id="friends-my-friends-personal-li" class="menu-child"><a href="https://DOMAIN.org/members/wvanvark/friends/#item-header-content">Friendships</a></li>
    	<li id="friends-my-friends-personal-li" class="menu-child"><a href="https://DOMAIN.org/members/wvanvark/friends/#item-header-content">Friendships</a></li>
    </ul>
    </li>
    <li id="donations-personal-li" class="menu-parent"><a href="https://DOMAIN.org/members/wvanvark/donations/#item-header-content">Donations</a></li>
    <li id="groups-personal-li" class="menu-parent"><a href="https://DOMAIN.org/members/wvanvark/groups/#item-header-content">Groups <span class="no-count">0</span></a>
    <ul class="sub-menu">
    	<li id="groups-my-groups-personal-li" class="menu-child"><a href="https://DOMAIN.org/members/wvanvark/groups/#item-header-content">Memberships</a></li>
    	<li id="groups-my-groups-personal-li" class="menu-child"><a href="https://DOMAIN.org/members/wvanvark/groups/#item-header-content">Memberships</a></li>
    	<li id="groups-my-groups-personal-li" class="menu-child"><a href="https://DOMAIN.org/members/wvanvark/groups/#item-header-content">Memberships</a></li>
    </ul>
    </li>
    <li id="location-personal-li" class="menu-parent"><a href="https://DOMAIN.org/members/wvanvark/location/#item-header-content">Location</a></li>
    <li id="my-account-personal-li" class="menu-parent"><a href="https://DOMAIN.org/members/wvanvark/my-account/#item-header-content">My Account</a></li>
    <li id="public-personal-li" class="menu-child current-menu-item"><a href="https://DOMAIN.org/members/wvanvark/profile/#item-header-content">View</a></li>
    <li id="public-personal-li" class="menu-child current-menu-item"><a href="https://DOMAIN.org/members/wvanvark/profile/#item-header-content">View</a></li>
    </ul></div> 
    		</ul>	
    </nav>	  

    Looking at own profile

    <nav class="main-navs no-ajax bp-navs single-screen-navs user-nav-tabs tabbed-links horizontal users-nav" id="object-nav" role="navigation" aria-label="Member menu">	  
    		<ul>
       <div class="menu-bp-container"><ul id="menu-bp" class="menu"><li id="front-personal-li" class="menu-parent"><a href="http://localhost/wordpress/members/athlete-lynn/front/#item-header-content">Home</a>
    <ul class="sub-menu">
    	<li id="public-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/front/#item-header-content">View</a></li>
    </ul>
    </li>
    <li id="xprofile-personal-li" class="menu-parent"><a href="http://localhost/wordpress/members/athlete-lynn/profile/#item-header-content">Profile</a></li>
    <li id="activity-personal-li" class="menu-parent"><a href="http://localhost/wordpress/members/athlete-lynn/activity/#item-header-content">Activity</a>
    <ul class="sub-menu">
    	<li id="just-me-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/activity/#item-header-content">Personal</a></li>
    	<li id="activity-mentions-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/activity/mentions/#item-header-content">Mentions</a></li>
    	<li id="activity-favs-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/activity/favorites/#item-header-content">Favorites</a></li>
    	<li id="activity-friends-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/activity/friends/#item-header-content">Friends</a></li>
    	<li id="activity-groups-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/activity/groups/#item-header-content">Groups</a></li>
    </ul>
    </li>
    <li id="friends-personal-li" class="menu-parent"><a href="http://localhost/wordpress/members/athlete-lynn/friends/#item-header-content">Friends <span class="count" style="cursor: pointer;">1</span></a>
    <ul class="sub-menu">
    	<li id="friends-my-friends-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/friends/#item-header-content">Friendships</a></li>
    	<li id="requests-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/friends/requests/#item-header-content">Requests</a></li>
    </ul>
    </li>
    <li id="notifications-personal-li" class="menu-parent"><a href="http://localhost/wordpress/members/athlete-lynn/notifications/#item-header-content">Notifications <span class="count" style="cursor: pointer;">1</span></a>
    <ul class="sub-menu">
    	<li id="notifications-my-notifications-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/notifications/#item-header-content">Unread</a></li>
    	<li id="read-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/notifications/read/#item-header-content">Read</a></li>
    </ul>
    </li>
    <li id="invite-anyone-personal-li" class="menu-parent"><a href="http://localhost/wordpress/members/athlete-lynn/invite-anyone/#item-header-content">Send Invites</a>
    <ul class="sub-menu">
    	<li id="invite-new-members-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/invite-anyone/#item-header-content">Invite New Members</a></li>
    	<li id="sent-invites-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/invite-anyone/sent-invites/#item-header-content">Sent Invites</a></li>
    </ul>
    </li>
    <li id="settings-personal-li" class="menu-parent current-menu-parent"><a href="http://localhost/wordpress/members/athlete-lynn/settings/#item-header-content">Settings</a>
    <ul class="sub-menu">
    	<li id="general-personal-li" class="menu-child current-menu-item"><a href="http://localhost/wordpress/members/athlete-lynn/settings/#item-header-content">General</a></li>
    	<li id="notifications-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/settings/notifications/#item-header-content">Email</a></li>
    	<li id="profile-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/settings/profile/#item-header-content">Profile Visibility</a>
    	<ul class="sub-menu">
    		<li id="public-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/profile/#item-header-content">View</a></li>
    		<li id="edit-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/profile/edit/#item-header-content">Edit</a></li>
    		<li id="change-avatar-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/profile/change-avatar/#item-header-content">Change Profile Photo</a></li>
    		<li id="change-cover-image-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/profile/change-cover-image/#item-header-content">Change Cover Image</a></li>
    	</ul>
    </li>
    	<li id="invites-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/settings/invites/#item-header-content">Group Invites</a></li>
    	<li id="data-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/settings/data/#item-header-content">Export Data</a></li>
    	<li id="delete-account-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/settings/delete-account/#item-header-content">Delete Account</a></li>
    </ul>
    </li>
    <li id="groups-personal-li" class="menu-parent"><a href="http://localhost/wordpress/members/athlete-lynn/groups/#item-header-content">Groups <span class="no-count">0</span></a>
    <ul class="sub-menu">
    	<li id="groups-my-groups-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/groups/#item-header-content">Memberships</a></li>
    	<li id="invites-personal-li" class="menu-child"><a href="http://localhost/wordpress/members/athlete-lynn/groups/invites/#item-header-content">Invitations</a></li>
    </ul>
    </li>
    </ul></div> 
    		</ul>	
    </nav>

    If you need to see the site you will you can register as an athlete or angel and that will allow you to view the members, Just realize this is not a live site yet so many other things are still being worked on.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Nahid Ferdous Mohit

    (@nfmohit)

    Hi @lynnapp!
    I hope you are having a great day!

    Thank you for your query and I apologise for the terrible delay.

    That is indeed very odd and is unexpected. I’m going to test it out as soon as possible and get back to you with an update here.

    Thank you for your patience.

    Kind regards,
    Nahid`

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.