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/template-tags.php

    r12907 r12908  
    515515
    516516            $buttons['activity_spam']['button_attr'][ $data_element ] = wp_nonce_url(
    517                 bp_get_root_domain() . '/' . bp_get_activity_slug() . '/spam/' . $activity_id . '/',
     517                bp_get_root_domain() . '/' . bp_nouveau_get_component_slug( 'activity' ) . '/spam/' . $activity_id . '/',
    518518                'bp_activity_akismet_spam_' . $activity_id
    519519            );
     
    843843
    844844            $buttons['activity_comment_spam']['button_attr'][ $data_element ] = wp_nonce_url(
    845                 bp_get_root_domain() . '/' . bp_get_activity_slug() . '/spam/' . $activity_comment_id . '/?cid=' . $activity_comment_id,
     845                bp_get_root_domain() . '/' . bp_nouveau_get_component_slug( 'activity' ) . '/spam/' . $activity_comment_id . '/?cid=' . $activity_comment_id,
    846846                'bp_activity_akismet_spam_' . $activity_comment_id
    847847            );
Note: See TracChangeset for help on using the changeset viewer.