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/buddypress/common/search-and-filters-bar.php

    r12907 r12908  
    99<div class="subnav-filters filters no-ajax" id="subnav-filters">
    1010
    11     <?php if ( bp_get_friends_slug() !== bp_current_component() ) : ?>
     11    <?php if ( bp_nouveau_get_component_slug( 'friends' ) !== bp_current_component() ) : ?>
    1212        <div class="subnav-search clearfix">
    1313
    14             <?php if ( bp_nouveau_is_feed_enable() ) : ?>
     14            <?php if ( bp_nouveau_get_component_slug( 'activity' ) === bp_current_component() && bp_nouveau_is_feed_enable() ) : ?>
    1515                <div id="activity-rss-feed" class="feed">
    1616                    <a href="<?php bp_nouveau_activity_rss_link(); ?>" class="bp-tooltip" data-bp-tooltip="<?php bp_nouveau_activity_rss_tooltip(); ?>">
     
    2727    <?php if ( bp_is_user() && ! bp_is_current_action( 'requests' ) ) : ?>
    2828        <?php bp_get_template_part( 'common/filters/user-screens-filters' ); ?>
    29     <?php elseif ( bp_get_groups_slug() === bp_current_component() ) : ?>
     29    <?php elseif ( bp_nouveau_get_component_slug( 'groups' ) === bp_current_component() ) : ?>
    3030        <?php bp_get_template_part( 'common/filters/groups-screens-filters' ); ?>
    3131    <?php else : ?>
Note: See TracChangeset for help on using the changeset viewer.