Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/20/2023 02:44:22 AM (15 months ago)
Author:
imath
Message:

Ensure the way the single group canonical stack is set is consistent

If the manage context does not need the current action to get the customized slugs for action variables, the read context does.

Moreover, as the current group is not set during the creation process, we don't need to get customized action variables for the create context.

Fixes #8940
See #4954
Closes https://github.com/buddypress/buddypress/pull/134

File:
1 edited

Legend:

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

    r13503 r13521  
    576576
    577577            if ( ! empty( $bp->action_variables ) ) {
     578                $chunks               = array( $current_action, $bp->action_variables );
    578579                $key_action_variables = 'single_item_action_variables';
    579580
    580581                if ( bp_is_group_admin_page() ) {
    581582                    $context = 'manage';
    582                 } elseif ( bp_is_group_create() ) {
    583                     $context              = 'create';
    584                     $key_action_variables = 'create_single_item_variables';;
    585                 }
    586 
    587                 $path_chunks                             = bp_groups_get_path_chunks( $bp->action_variables, $context );
     583                    array_shift( $chunks );
     584                }
     585
     586                $path_chunks                             = bp_groups_get_path_chunks( $chunks, $context );
    588587                $bp->canonical_stack['action_variables'] = bp_action_variables();
    589588
Note: See TracChangeset for help on using the changeset viewer.