Skip to:
Content

BuddyPress.org

Changeset 12703


Ignore:
Timestamp:
08/11/2020 09:11:46 PM (4 years ago)
Author:
imath
Message:

BP Nouveau: make sure activity filter change triggers an Ajax request

The BP Nouveau Template pack uses data-attributes to check what Ajax request needs to be performed. When the Group’s front page is disabled from the BP Nouveau customizer section, Activities are displayed on Group’s home page. It appeared the activity filter selector’s data-attributes were wrongly set to home.

To make this filter behaves the right way, we need to override the component’s object and data filter to activity into the bp_nouveau_current_object() template tag.

Props etatus

Fixes #8342

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-nouveau/includes/template-tags.php

    r12623 r12703  
    44 *
    55 * @since 3.0.0
    6  * @version 6.0.0
     6 * @version 7.0.0
    77 */
    88
     
    20362036
    20372037        if ( 'activity' !== bp_current_action() ) {
    2038             $component['data_filter'] = 'group_' . bp_current_action();
     2038            /**
     2039             * If the Group's front page is not used, Activities are displayed on Group's home page.
     2040             * To make sure filters are behaving the right way, we need to override the component object
     2041             * and data filter to `activity`.
     2042             */
     2043            if ( bp_is_group_activity() ) {
     2044                $activity_id              = buddypress()->activity->id;
     2045                $component['object']      = $activity_id;
     2046                $component['data_filter'] = $activity_id;
     2047            } else {
     2048                $component['data_filter'] = 'group_' . bp_current_action();
     2049            }
    20392050        }
    20402051
Note: See TracChangeset for help on using the changeset viewer.