[buddypress-trac] [BuddyPress Trac] #9013: Invitations missing from BuddyPress Member logged in menu items [BP 12.0.0.beta3]
buddypress-trac
noreply at wordpress.org
Mon Oct 30 16:38:15 UTC 2023
#9013: Invitations missing from BuddyPress Member logged in menu items [BP
12.0.0.beta3]
--------------------------+-----------------------------
Reporter: emaralive | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Members | Version:
Severity: normal | Keywords:
--------------------------+-----------------------------
With any compatible WP branch (example screenshots are with **WP 6.3.2**),
**BP 12.0.0.beta3**, any compatible PHP version (example screenshots are
with **PHP 7.4.33**) and the following:
**Active components:**
Community Members, Extended Profiles, Account Settings, Friend
Connections, Private Messaging, Activity Streams, Notifications, User
Groups, Site Tracking
**Active template pack:**
BuddyPress Nouveau
**Parent Theme**:
Twenty Eleven (twentyeleven)
Scenario with **BP Classic plugin activated** and with **BuddyPress
Settings->options**, the **Invitations checkbox is checked/enabled**:
[**Back-end**] The BuddyPress Member Invitation menu item
(**appearance->menu**) is visible/present (see **screenshot-
win10-me-2023.10.24-11_34_16.png**).
[**Front-end**] The BuddyPress Member Invitation menu item is
visible/present (see **screenshot-win10-me-2023.10.24-12_23_57.png**).
Scenario with **BP Classic plugin deactivated** and with **BuddyPress
Settings->options**, the **Invitations checkbox is checked/enabled**:
[**Back-end**] The BuddyPress Member **Invitation** menu item
(**appearance->menu**) is missing/not present (see **screenshot-
win10-me-2023.10.24-12_35_45.png**).
[**Front-end**] The BuddyPress Member **Invitation** menu item is
missing/not present (see **screenshot-win10-me-2023.10.24-12_46_29.pn**g).
BTW, the same applies to the theme customizer
(**appearance->customize->menus->your_menu->add items**); moving along,
the function **{{{bp_nav_menu_get_loggedin_pages}}}** (**found around line
2801 in bp-core/bp-core-functions.php**) is where we find the call to
**{{{bp_get_component_navigations}}}** (**found around line 2815**) which
is used to retrieve the active components navigation data (**main_nav**)
to help construct the menu items found in the **BuddyPress Member
metabox**. Unfortunately, Invitations is not a component but is,
apparently, a feature of the "**members**" component, thus, will not be
not found via the call to **{{{bp_get_component_navigations}}}**. Given
this strategy of active components navigation retrieval, it seems that
**Invitations** should, possibly, be handled the same as the **Log Out**
menu item of which the comments read (**starting on line 2835**):
{{{
// Some BP nav menu items will not be represented in bp_nav, because
// they are not real BP components. We add them manually here.
}}}
If this is the way that "**not real BP components**" are to be included as
**BP nav menu items** then, OK, simple enough, except, I would add the
following within the else statement after the foreach loop:
{{{
if ( bp_get_members_invitations_allowed() ) {
$invitations_slug = bp_get_members_invitations_slug();
$bp_menu_items[] = array(
'name' => __( 'Invitations', 'buddypress' ),
'slug' => $invitations_slug,
'link' => bp_loggedin_user_url(
bp_members_get_path_chunks( array( $invitations_slug ) ) ),
);
}
}}}
As to how this issue gets fixed is up to whomever is assigned, the example
provided is just one way of providing such fix.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/9013>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list