Skip to:
Content

BuddyPress.org

Ticket #7732: 7732.1.diff

File 7732.1.diff, 2.6 KB (added by dcavins, 6 years ago)

Fixes for bp_nouveau_group_creation_tabs().

  • src/bp-templates/bp-nouveau/buddypress/groups/single/admin/edit-details.php

    diff --git a/src/bp-templates/bp-nouveau/buddypress/groups/single/admin/edit-details.php b/src/bp-templates/bp-nouveau/buddypress/groups/single/admin/edit-details.php
    index bcaf99a7d..305a6d563 100644
    a b  
    66 */
    77?>
    88<h2 class="bp-screen-title <?php if ( bp_is_group_create() ) { echo esc_attr( 'creation-step-name' ); } ?>">
    9         <?php _e( 'Edit your groups name &amp; description', 'buddypress' ); ?>
     9        <?php _e( 'Edit your group&rsquo;s name &amp; description', 'buddypress' ); ?>
    1010</h2>
    1111
    1212<label for="group-name"><?php _e( 'Group Name (required)', 'buddypress' ); ?></label>
  • src/bp-templates/bp-nouveau/includes/groups/template-tags.php

    diff --git a/src/bp-templates/bp-nouveau/includes/groups/template-tags.php b/src/bp-templates/bp-nouveau/includes/groups/template-tags.php
    index bd004f4b6..6d39b15c5 100644
    a b function bp_nouveau_group_creation_tabs() { 
    217217                $bp->groups->current_create_step = array_shift( $keys );
    218218        }
    219219
    220         $counter = 1;
    221 
    222         foreach ( (array) $bp->groups->group_creation_steps as $slug => $step ) {
    223                 $is_enabled = bp_are_previous_group_creation_steps_complete( $slug ); ?>
     220        $counter              = 1;
     221        $last_accessible_step = '';
    224222
     223        foreach ( $bp->groups->group_creation_steps as $slug => $step ) {
     224                /*
     225                 * Has the user worked through to the current step?
     226                 * If not, use the last accessible step's slug and mark the link "disabled."
     227                 */
     228                if ( bp_are_previous_group_creation_steps_complete( $slug ) ) {
     229                        $disabled_attr        = '';
     230                        $last_accessible_step = $slug;
     231                } else {
     232                        $disabled_attr = ' disabled="disabled"';
     233                }
     234                ?>
    225235                <li<?php if ( bp_get_groups_current_create_step() === $slug ) : ?> class="current"<?php endif; ?>>
    226                         <?php if ( $is_enabled ) : ?>
    227                                 <a href="<?php echo esc_url( bp_groups_directory_permalink() . 'create/step/' . $slug . '/' ); ?>">
    228                                         <?php echo (int) $counter; ?> <?php echo esc_html( $step['name'] ); ?>
    229                                 </a>
    230                         <?php else : ?>
    231                                 <a disabled="disabled"><?php echo (int) $counter; ?>. <?php echo esc_html( $step['name'] ); ?></a>
    232                         <?php endif ?>
     236                        <a href="<?php echo esc_url( bp_get_groups_directory_permalink() . 'create/step/' . $last_accessible_step . '/' ); ?>"<?php echo $disabled_attr; ?>>
     237                                <?php echo (int) $counter; ?>. <?php echo esc_html( $step['name'] ); ?>
     238                        </a>
    233239                </li>
    234                         <?php
     240                <?php
    235241                $counter++;
    236242        }
    237243
    238         unset( $is_enabled );
    239 
    240244        /**
    241245         * Fires at the end of the creation of the group tabs.
    242246         *