Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/30/2023 06:48:08 AM (3 years ago)
Author:
imath
Message:

Restore the Member’s activity single view

A regression introduced in [13512] was preventing single activities to successfully load into the BP Nouveau Template Pack. We need to only perform the parse query check when viewing a single user. In the case of a single activity there is no need to check for an existing Member’s (sub)navigation item.

See #8932
Fixes #8956
Closes https://github.com/buddypress/buddypress/pull/143

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-members/classes/class-bp-members-component.php

    r13522 r13534  
    978978         */
    979979        public function check_parsed_query() {
    980                 $single_item_component = '';
    981980                if ( bp_is_user() ) {
    982981                        $single_item_component = bp_current_component();
    983                 }
    984 
    985                 $single_item_action = '';
    986                 if ( $single_item_component ) {
    987                         $single_item_action = bp_current_action();
    988                 }
    989 
    990                 $bp = buddypress();
    991                 if ( isset( $bp->{$single_item_component}, $bp->{$single_item_component}->sub_nav ) ) {
    992                         $screen_functions = wp_list_pluck( $bp->{$single_item_component}->sub_nav, 'screen_function', 'slug' );
    993 
    994                         if ( ! $single_item_action || ! isset( $screen_functions[ $single_item_action ] ) || ! is_callable( $screen_functions[ $single_item_action ] ) ) {
    995                                 bp_do_404();
     982
     983                        $single_item_action = '';
     984                        if ( $single_item_component ) {
     985                                $single_item_action = bp_current_action();
     986                        }
     987
     988                        // Viewing a single activity.
     989                        if ( 'activity' === $single_item_component && is_numeric( $single_item_action ) ) {
    996990                                return;
     991                        }
     992
     993                        $bp = buddypress();
     994                        if ( isset( $bp->{$single_item_component}, $bp->{$single_item_component}->sub_nav ) ) {
     995                                $screen_functions = wp_list_pluck( $bp->{$single_item_component}->sub_nav, 'screen_function', 'slug' );
     996
     997                                if ( ! $single_item_action || ! isset( $screen_functions[ $single_item_action ] ) || ! is_callable( $screen_functions[ $single_item_action ] ) ) {
     998                                        bp_do_404();
     999                                        return;
     1000                                }
    9971001                        }
    9981002                }
Note: See TracChangeset for help on using the changeset viewer.