Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/27/2021 06:59:23 AM (4 years ago)
Author:
imath
Message:

BP Nouveau: introduce a function to get active component slugs

bp_nouveau_get_component_slug() accepts the component's ID as an argument and uses the bp_get_{$component_id}_slug() corresponding function to get its slug only if the component is active.

Replace all occurences of bp_get_{$component_id}_slug() by bp_nouveau_get_component_slug( $component_id ) to prevent errors.

Fixes #8464

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-nouveau/includes/activity/functions.php

    r12814 r12908  
    44 *
    55 * @since 3.0.0
    6  * @version 7.0.0
     6 * @version 8.0.0
    77 */
    88
     
    227227                'slug'      => 'favorites', // slug is used because BP_Core_Nav requires it, but it's the scope
    228228                'li_class'  => array(),
    229                 'link'      => bp_loggedin_user_domain() . bp_get_activity_slug() . '/favorites/',
     229                'link'      => bp_loggedin_user_domain() . bp_nouveau_get_component_slug( 'activity' ) . '/favorites/',
    230230                'text'      => __( 'My Favorites', 'buddypress' ),
    231231                'count'     => false,
     
    240240                'slug'      => 'friends', // slug is used because BP_Core_Nav requires it, but it's the scope
    241241                'li_class'  => array( 'dynamic' ),
    242                 'link'      => bp_loggedin_user_domain() . bp_get_activity_slug() . '/' . bp_get_friends_slug() . '/',
     242                'link'      => bp_loggedin_user_domain() . bp_nouveau_get_component_slug( 'activity' ) . '/' . bp_nouveau_get_component_slug( 'friends' ) . '/',
    243243                'text'      => __( 'My Friends', 'buddypress' ),
    244244                'count'     => '',
     
    253253                'slug'      => 'groups', // slug is used because BP_Core_Nav requires it, but it's the scope
    254254                'li_class'  => array( 'dynamic' ),
    255                 'link'      => bp_loggedin_user_domain() . bp_get_activity_slug() . '/' . bp_get_groups_slug() . '/',
     255                'link'      => bp_loggedin_user_domain() . bp_nouveau_get_component_slug( 'activity' ) . '/' . bp_nouveau_get_component_slug( 'groups' ) . '/',
    256256                'text'      => __( 'My Groups', 'buddypress' ),
    257257                'count'     => '',
     
    273273                'slug'      => 'mentions', // slug is used because BP_Core_Nav requires it, but it's the scope
    274274                'li_class'  => array( 'dynamic' ),
    275                 'link'      => bp_loggedin_user_domain() . bp_get_activity_slug() . '/mentions/',
     275                'link'      => bp_loggedin_user_domain() . bp_nouveau_get_component_slug( 'activity' ) . '/mentions/',
    276276                'text'      => __( 'Mentions', 'buddypress' ),
    277277                'count'     => $count,
Note: See TracChangeset for help on using the changeset viewer.