Skip to:
Content

BuddyPress.org

Opened 6 years ago

Closed 6 years ago

#5987 closed defect (bug)

BP_FORUMS_SLUG doesn't work for groups forums

Reported by: slaFFik Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Forums Keywords:
Cc:

Description

When I define BP_FORUMS_SLUG I change the way the slug of /members/slaffik/forums looks like.
Though this doesn't work for Groups -> Forums.

Reason is this:

// Forums are enabled and turned on
if ( $this->current_group->enable_forum && bp_is_active( 'forums' ) ) {
    $sub_nav[] = array(
        'name'            => _x( 'Forum', 'My Group screen nav', 'buddypress' ),
        'slug'            => 'forum',
        'parent_url'      => $group_link,
        'parent_slug'     => $this->current_group->slug,
        'screen_function' => 'groups_screen_group_forum',
        'position'        => 40,
        'user_has_access' => $this->current_group->user_has_access,
        'item_css_id'     => 'forums'
    );
}

As you can see, 'forum' is hardcoded. Can you use this logic:

 isset( $bp->pages->forums->slug ) ? $bp->pages->forums->slug : BP_FORUMS_SLUG,

as in bp-forums/bp-forums-loader.php around line 67 (in BuddyPress 2.1.1)

Change History (3)

#1 @espellcaste
6 years ago

Wouldn't it supposed to be the other way around?! Or am I missing something here?!

 isset( $bp->pages->forums->slug ) ? BP_FORUMS_SLUG : $bp->pages->forums->slug,

Use BP_FORUMS_SLUG if available and then a fallback if it's not. In this case, the default behavior.

This ticket was mentioned in Slack in #buddypress by slaffik. View the logs.


6 years ago

#3 @r-a-y
6 years ago

  • Milestone Awaiting Review deleted
  • Status changed from new to closed

Going to mark this as a duplicate of #2086 as that ticket encompasses all other hardcoded slugs.

Note: See TracTickets for help on using tickets.