Skip to:
Content

BuddyPress.org

Ticket #8427: 8427.patch

File 8427.patch, 1.9 KB (added by imath, 4 years ago)
  • src/bp-templates/bp-nouveau/includes/template-tags.php

    diff --git src/bp-templates/bp-nouveau/includes/template-tags.php src/bp-templates/bp-nouveau/includes/template-tags.php
    index ed509377a..3439280fb 100644
    function bp_nouveau_loop_classes() { 
    547547                $bp_nouveau = bp_nouveau();
    548548
    549549                // @todo: this function could do with passing args so we can pass simple strings in or array of strings
     550                $is_directory = bp_is_directory();
    550551
    551552                // The $component is faked if it's the single group member loop
    552                 if ( ! bp_is_directory() && ( bp_is_group() && 'members' === bp_current_action() ) ) {
     553                if ( ! $is_directory && ( bp_is_group() && 'members' === bp_current_action() ) ) {
    553554                        $component = 'members_group';
    554                 } elseif ( ! bp_is_directory() && ( bp_is_user() && 'my-friends' === bp_current_action() ) ) {
     555                } elseif ( ! $is_directory && ( bp_is_user() && 'my-friends' === bp_current_action() ) ) {
    555556                        $component = 'members_friends';
    556557                } else {
    557558                        $component = sanitize_key( bp_current_component() );
    558559                }
    559560
     561                /*
     562                 * For the groups component, we need to take in account the
     563                 * Groups directory can list Groups according to a Group Type.
     564                 */
     565                if ( 'groups' === $component ) {
     566                        $is_directory = bp_is_groups_directory();
     567                }
     568
    560569                $classes = array(
    561570                        'item-list',
    562571                        sprintf( '%s-list', str_replace( '_', '-', $component ) ),
    function bp_nouveau_loop_classes() { 
    584593                );
    585594
    586595                // Only the available components supports custom layouts.
    587                 if ( ! empty( $available_components[ $component ] ) && ( bp_is_directory() || bp_is_group() || bp_is_user() ) ) {
     596                if ( ! empty( $available_components[ $component ] ) && ( $is_directory || bp_is_group() || bp_is_user() ) ) {
    588597                        $customizer_option = sprintf( '%s_layout', $component );
    589598                        $layout_prefs      = bp_nouveau_get_temporary_setting(
    590599                                $customizer_option,