Skip to:
Content

BuddyPress.org

Changeset 11313


Ignore:
Timestamp:
12/20/2016 02:59:49 AM (5 years ago)
Author:
boonebgorges
Message:

Groups: Set new_group_id global during group component setup.

This ensures that the global value is set early enough to be passed
to the create_screen() method of BP_Group_Extension objects.

Props dcavins.
Fixes #7386.

Location:
trunk/src/bp-groups
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/bp-groups-actions.php

    r11146 r11313  
    157157
    158158    // Set the ID of the new group, if it has already been created in a previous step.
    159     if ( isset( $_COOKIE['bp_new_group_id'] ) ) {
    160         $bp->groups->new_group_id = (int) $_COOKIE['bp_new_group_id'];
     159    if ( bp_get_new_group_id() ) {
    161160        $bp->groups->current_group = groups_get_group( $bp->groups->new_group_id );
    162161
  • trunk/src/bp-groups/classes/class-bp-groups-component.php

    r11145 r11313  
    270270        } else {
    271271            $this->current_group = 0;
     272        }
     273
     274        // Set up variables specific to the group creation process.
     275        if ( bp_is_groups_component() && bp_is_current_action( 'create' ) && bp_user_can_create_groups() && isset( $_COOKIE['bp_new_group_id'] ) ) {
     276            $bp->groups->new_group_id = (int) $_COOKIE['bp_new_group_id'];
    272277        }
    273278
Note: See TracChangeset for help on using the changeset viewer.