Skip to:
Content

BuddyPress.org

Changeset 13202


Ignore:
Timestamp:
12/31/2021 01:19:41 PM (2 years ago)
Author:
imath
Message:

Apply filters to edit Group create steps once all Core steps are set

The 'groups_create_group_steps' has been moved below the code defining all default group creation steps. This move gives more customization possibilities to plugin author than before: they can, like BP Nouveau is doing for the Group invites step, edit the name of all steps as well as their position during the creation process.

Fixes #8609

File:
1 edited

Legend:

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

    r13156 r13202  
    365365        }
    366366
    367         /**
    368          * Filters the preconfigured groups creation steps.
    369          *
    370          * @since 1.1.0
    371          *
    372          * @param array $value Array of preconfigured group creation steps.
    373          */
    374         $this->group_creation_steps = apply_filters( 'groups_create_group_steps', array(
     367        // Set default Group creation steps.
     368        $group_creation_steps = array(
    375369            'group-details'  => array(
    376370                'name'       => _x( 'Details', 'Group screen nav', 'buddypress' ),
     
    381375                'position'   => 10
    382376            )
    383         ) );
     377        );
    384378
    385379        // If avatar uploads are not disabled, add avatar option.
    386380        $disabled_avatar_uploads = (int) bp_disable_group_avatar_uploads();
    387381        if ( ! $disabled_avatar_uploads && $bp->avatar->show_avatars ) {
    388             $this->group_creation_steps['group-avatar'] = array(
     382            $group_creation_steps['group-avatar'] = array(
    389383                'name'     => _x( 'Photo', 'Group screen nav', 'buddypress' ),
    390384                'position' => 20
     
    393387
    394388        if ( bp_group_use_cover_image_header() ) {
    395             $this->group_creation_steps['group-cover-image'] = array(
     389            $group_creation_steps['group-cover-image'] = array(
    396390                'name'     => _x( 'Cover Image', 'Group screen nav', 'buddypress' ),
    397391                'position' => 25
     
    401395        // If invitations are enabled, add invitations.
    402396        if ( bp_is_active( 'groups', 'invitations' ) ) {
    403             $this->group_creation_steps['group-invites'] = array(
     397            $group_creation_steps['group-invites'] = array(
    404398                'name'     => _x( 'Invites',  'Group screen nav', 'buddypress' ),
    405399                'position' => 30
    406400            );
    407401        }
     402
     403        /**
     404         * Filters the preconfigured groups creation steps.
     405         *
     406         * @since 1.1.0
     407         *
     408         * @param array $value Array of preconfigured group creation steps.
     409         */
     410        $this->group_creation_steps = apply_filters( 'groups_create_group_steps', $group_creation_steps );
    408411
    409412        /**
Note: See TracChangeset for help on using the changeset viewer.