Skip to:
Content

BuddyPress.org

Ticket #8391: 8391.patch

File 8391.patch, 22.3 KB (added by imath, 5 years ago)
  • src/bp-groups/bp-groups-template.php

    diff --git src/bp-core/images/bp-blocks.gif src/bp-core/images/bp-blocks.gif
    index 4c59d23f5..d463872fa 100644
    Binary files src/bp-core/images/bp-blocks.gif and src/bp-core/images/bp-blocks.gif differ
    diff --git src/bp-groups/bp-groups-template.php src/bp-groups/bp-groups-template.php
    index 7cf4be97e..d0be0cc70 100644
    function bp_group_type_list( $group_id = 0, $r = array() ) { 
    227227                        $group_id = bp_get_current_group_id();
    228228                }
    229229
    230                 $r = bp_parse_args( $r, array(
    231                         'parent_element' => 'p',
    232                         'parent_attr'    => array(
    233                                  'class' => 'bp-group-type-list',
     230                $r = bp_parse_args(
     231                        $r,
     232                        array(
     233                                'parent_element'    => 'p',
     234                                'parent_attr'       => array(
     235                                        'class' => 'bp-group-type-list',
     236                                ),
     237                                'label'             => __( 'Group Types:', 'buddypress' ),
     238                                'label_element'     => 'strong',
     239                                'label_attr'        => array(),
     240                                'show_all'          => false,
     241                                'list_element'      => '',
     242                                'list_element_attr' => array(),
    234243                        ),
    235                         'label'          => __( 'Group Types:', 'buddypress' ),
    236                         'label_element'  => 'strong',
    237                         'label_attr'     => array(),
    238                         'show_all'       => false,
    239                 ), 'group_type_list' );
     244                        'group_type_list'
     245                );
    240246
    241247                $retval = '';
    242248
    function bp_group_type_list( $group_id = 0, $r = array() ) { 
    277283                                $label = esc_html( $r['label'] );
    278284                        }
    279285
     286                        // The list of types.
     287                        $list = implode( ', ', array_map( 'bp_get_group_type_directory_link', $types ) );
     288
     289                        // Render the list of types element.
     290                        if ( ! empty( $r['list_element'] ) ) {
     291                                $list_element = new BP_Core_HTML_Element( array(
     292                                        'element'    => $r['list_element'],
     293                                        'attr'       => $r['list_element_attr'],
     294                                        'inner_html' => $list,
     295                                ) );
     296
     297                                $list = $list_element->contents();
     298                        }
     299
    280300                        // Comma-delimit each type into the group type directory link.
    281                         $label .= implode( ', ', array_map( 'bp_get_group_type_directory_link', $types ) );
     301                        $label .= $list;
    282302
    283303                        // Retval time!
    284304                        $retval = $before . $label . $after;
    function bp_group_total_members( $group = false ) { 
    20172037 * Output the "x members" count string for a group.
    20182038 *
    20192039 * @since 1.2.0
     2040 * @since 7.0.0 Adds the `$group` optional parameter.
     2041 *
     2042 * @param object|bool $group Optional. Group object. Default: current group in loop.
    20202043 */
    2021 function bp_group_member_count() {
    2022         echo bp_get_group_member_count();
     2044function bp_group_member_count( $group = false ) {
     2045        echo bp_get_group_member_count( $group );
    20232046}
    20242047        /**
    20252048         * Generate the "x members" count string for a group.
    20262049         *
    20272050         * @since 1.2.0
    20282051         *
     2052         * @since 7.0.0 Adds the `$group` optional parameter.
     2053         *
     2054         * @param object|bool $group Optional. Group object. Default: current group in loop.
    20292055         * @return string
    20302056         */
    2031         function bp_get_group_member_count() {
     2057        function bp_get_group_member_count( $group = false ) {
    20322058                global $groups_template;
    20332059
    2034                 if ( isset( $groups_template->group->total_member_count ) ) {
     2060                if ( isset( $group->total_member_count ) ) {
     2061                        $count = (int) $group->total_member_count;
     2062                } elseif ( isset( $groups_template->group->total_member_count ) ) {
    20352063                        $count = (int) $groups_template->group->total_member_count;
    20362064                } else {
    20372065                        $count = 0;
  • src/bp-templates/bp-nouveau/buddypress/groups/groups-loop.php

    diff --git src/bp-templates/bp-nouveau/buddypress/groups/groups-loop.php src/bp-templates/bp-nouveau/buddypress/groups/groups-loop.php
    index bbd574231..c0c7eb975 100644
     
    33 * BuddyPress - Groups Loop
    44 *
    55 * @since 3.0.0
    6  * @version 3.1.0
     6 * @version 7.0.0
    77 */
    88
    99bp_nouveau_before_loop(); ?>
    bp_nouveau_before_loop(); ?> 
    1818
    1919        <ul id="groups-list" class="<?php bp_nouveau_loop_classes(); ?>">
    2020
    21         <?php
    22         while ( bp_groups() ) :
    23                 bp_the_group();
    24         ?>
     21                <?php while ( bp_groups() ) : bp_the_group(); ?>
    2522
    26                 <li <?php bp_group_class( array( 'item-entry' ) ); ?> data-bp-item-id="<?php bp_group_id(); ?>" data-bp-item-component="groups">
    27                         <div class="list-wrap">
     23                        <li <?php bp_group_class( array( 'item-entry' ) ); ?> data-bp-item-id="<?php bp_group_id(); ?>" data-bp-item-component="groups">
     24                                <div class="list-wrap">
    2825
    29                                 <?php if ( ! bp_disable_group_avatar_uploads() ) : ?>
    30                                         <div class="item-avatar">
    31                                                 <a href="<?php bp_group_permalink(); ?>"><?php bp_group_avatar( bp_nouveau_avatar_args() ); ?></a>
    32                                         </div>
    33                                 <?php endif; ?>
     26                                        <?php if ( ! bp_disable_group_avatar_uploads() ) : ?>
     27                                                <div class="item-avatar">
     28                                                        <a href="<?php bp_group_permalink(); ?>"><?php bp_group_avatar( bp_nouveau_avatar_args() ); ?></a>
     29                                                </div>
     30                                        <?php endif; ?>
    3431
    35                                 <div class="item">
     32                                        <div class="item">
    3633
    37                                         <div class="item-block">
     34                                                <div class="item-block">
    3835
    39                                                 <h2 class="list-title groups-title"><?php bp_group_link(); ?></h2>
     36                                                        <h2 class="list-title groups-title"><?php bp_group_link(); ?></h2>
    4037
    41                                                 <?php if ( bp_nouveau_group_has_meta() ) : ?>
     38                                                        <?php if ( bp_nouveau_group_has_meta() ) : ?>
    4239
    43                                                         <p class="item-meta group-details"><?php bp_nouveau_group_meta(); ?></p>
     40                                                                <p class="item-meta group-details"><?php bp_nouveau_the_group_meta( array( 'keys' => array( 'status', 'count' ) ) ); ?></p>
    4441
    45                                                 <?php endif; ?>
     42                                                        <?php endif; ?>
    4643
    47                                                 <p class="last-activity item-meta">
    48                                                         <?php
    49                                                         printf(
    50                                                                 /* translators: %s: last activity timestamp (e.g. "active 1 hour ago") */
    51                                                                 __( 'active %s', 'buddypress' ),
    52                                                                 bp_get_group_last_active()
    53                                                         );
    54                                                         ?>
    55                                                 </p>
     44                                                        <p class="last-activity item-meta">
     45                                                                <?php
     46                                                                        printf(
     47                                                                                /* translators: %s: last activity timestamp (e.g. "active 1 hour ago") */
     48                                                                                esc_html__( 'Active %s', 'buddypress' ),
     49                                                                                sprintf(
     50                                                                                        '<span data-livestamp="%1$s">%2$s</span>',
     51                                                                                        bp_core_get_iso8601_date( bp_get_group_last_active( 0, array( 'relative' => false ) ) ),
     52                                                                                        esc_html( bp_get_group_last_active() )
     53                                                                                )
     54                                                                        );
     55                                                                ?>
     56                                                        </p>
    5657
    57                                         </div>
     58                                                </div>
    5859
    59                                         <div class="group-desc"><p><?php bp_nouveau_group_description_excerpt(); ?></p></div>
     60                                                <div class="group-desc"><p><?php bp_nouveau_group_description_excerpt(); ?></p></div>
    6061
    61                                         <?php bp_nouveau_groups_loop_item(); ?>
     62                                                <?php bp_nouveau_groups_loop_item(); ?>
    6263
    63                                         <?php bp_nouveau_groups_loop_buttons(); ?>
     64                                                <?php bp_nouveau_groups_loop_buttons(); ?>
    6465
    65                                 </div>
     66                                        </div>
    6667
     68                                </div>
    6769
    68                         </div>
    69                 </li>
     70                        </li>
    7071
    71         <?php endwhile; ?>
     72                <?php endwhile; ?>
    7273
    7374        </ul>
    7475
  • src/bp-templates/bp-nouveau/buddypress/groups/single/cover-image-header.php

    diff --git src/bp-templates/bp-nouveau/buddypress/groups/single/cover-image-header.php src/bp-templates/bp-nouveau/buddypress/groups/single/cover-image-header.php
    index c5ed20f05..356ae26e9 100644
     
    33 * BuddyPress - Groups Cover Image Header.
    44 *
    55 * @since 3.0.0
    6  * @version 3.2.0
     6 * @version 7.0.0
    77 */
    88?>
    99
     
    2121                        </div><!-- #item-header-avatar -->
    2222                <?php endif; ?>
    2323
    24 <?php   if ( ! bp_nouveau_groups_front_page_description() ) : ?>
    25                 <div id="item-header-content">
     24                <?php if ( ! bp_nouveau_groups_front_page_description() ) : ?>
     25                        <div id="item-header-content">
     26
     27                                <?php if ( bp_nouveau_group_has_meta( 'status' ) ) : ?>
     28                                        <p class="highlight group-status"><strong><?php echo esc_html( bp_nouveau_the_group_meta( array( 'keys' => 'status' ) ) ); ?></strong></p>
     29                                <?php endif; ?>
     30
     31                                <p class="activity">
     32                                        <?php
     33                                                printf(
     34                                                        /* translators: %s: last activity timestamp (e.g. "active 1 hour ago") */
     35                                                        esc_html__( 'Active %s', 'buddypress' ),
     36                                                        sprintf(
     37                                                                '<span data-livestamp="%1$s">%2$s</span>',
     38                                                                bp_core_get_iso8601_date( bp_get_group_last_active( 0, array( 'relative' => false ) ) ),
     39                                                                esc_html( bp_get_group_last_active() )
     40                                                        )
     41                                                );
     42                                        ?>
     43                                </p>
    2644
    27                         <p class="highlight group-status"><strong><?php echo esc_html( bp_nouveau_group_meta()->status ); ?></strong></p>
    28                         <p class="activity" data-livestamp="<?php bp_core_iso8601_date( bp_get_group_last_active( 0, array( 'relative' => false ) ) ); ?>">
    2945                                <?php
    30                                 /* translators: %s: last activity timestamp (e.g. "active 1 hour ago") */
    31                                 printf( __( 'active %s', 'buddypress' ), bp_get_group_last_active() );
     46                                bp_group_type_list(
     47                                        bp_get_group_id(),
     48                                        array(
     49                                                'label'        => __( 'Group Types', 'buddypress' ),
     50                                                'list_element' => 'span',
     51                                        )
     52                                );
    3253                                ?>
    33                         </p>
    3454
    35                         <?php echo bp_nouveau_group_meta()->group_type_list; ?>
    36                         <?php bp_nouveau_group_hook( 'before', 'header_meta' ); ?>
     55                                <?php bp_nouveau_group_hook( 'before', 'header_meta' ); ?>
    3756
    38                         <?php if ( bp_nouveau_group_has_meta_extra() ) : ?>
    39                                 <div class="item-meta">
     57                                <?php if ( bp_nouveau_group_has_meta_extra() ) : ?>
     58                                        <div class="item-meta">
    4059
    41                                         <?php echo bp_nouveau_group_meta()->extra; ?>
     60                                                <?php echo bp_nouveau_the_group_meta( array( 'keys' => 'extra' ) ); ?>
    4261
    43                                 </div><!-- .item-meta -->
    44                         <?php endif; ?>
     62                                        </div><!-- .item-meta -->
     63                                <?php endif; ?>
    4564
    46                         <?php bp_nouveau_group_header_buttons(); ?>
     65                                <?php bp_nouveau_group_header_buttons(); ?>
    4766
    48                 </div><!-- #item-header-content -->
    49 <?php endif; ?>
     67                        </div><!-- #item-header-content -->
     68                <?php endif; ?>
    5069
    5170                <?php bp_get_template_part( 'groups/single/parts/header-item-actions' ); ?>
    5271
  • src/bp-templates/bp-nouveau/buddypress/groups/single/group-header.php

    diff --git src/bp-templates/bp-nouveau/buddypress/groups/single/group-header.php src/bp-templates/bp-nouveau/buddypress/groups/single/group-header.php
    index d082ea412..11ff03a5a 100644
     
    33 * BuddyPress - Groups Header
    44 *
    55 * @since 3.0.0
    6  * @version 3.2.0
     6 * @version 7.0.0
    77 */
    88?>
    99
     
    2121
    2222<div id="item-header-content">
    2323
    24         <p class="highlight group-status"><strong><?php echo esc_html( bp_nouveau_group_meta()->status ); ?></strong></p>
     24        <?php if ( bp_nouveau_group_has_meta( 'status' ) ) : ?>
     25                <p class="highlight group-status"><strong><?php echo esc_html( bp_nouveau_the_group_meta( array( 'keys' => 'status' ) ) ); ?></strong></p>
     26        <?php endif; ?>
    2527
    26         <p class="activity" data-livestamp="<?php bp_core_iso8601_date( bp_get_group_last_active( 0, array( 'relative' => false ) ) ); ?>">
     28        <p class="activity">
    2729                <?php
    28                 echo esc_html(
    29                         sprintf(
     30                        printf(
    3031                                /* translators: %s: last activity timestamp (e.g. "active 1 hour ago") */
    31                                 __( 'active %s', 'buddypress' ),
    32                                 bp_get_group_last_active()
    33                         )
    34                 );
     32                                esc_html__( 'Active %s', 'buddypress' ),
     33                                sprintf(
     34                                        '<span data-livestamp="%1$s">%2$s</span>',
     35                                        bp_core_get_iso8601_date( bp_get_group_last_active( 0, array( 'relative' => false ) ) ),
     36                                        esc_html( bp_get_group_last_active() )
     37                                )
     38                        );
    3539                ?>
    3640        </p>
    3741
     42        <?php
     43        bp_group_type_list(
     44                bp_get_group_id(),
     45                array(
     46                        'label'        => __( 'Group Types', 'buddypress' ),
     47                        'list_element' => 'span',
     48                )
     49        );
     50        ?>
     51
    3852        <?php bp_nouveau_group_hook( 'before', 'header_meta' ); ?>
    3953
    4054        <?php if ( bp_nouveau_group_has_meta_extra() ) : ?>
    4155                <div class="item-meta">
    4256
    43                         <?php echo bp_nouveau_group_meta()->extra; ?>
     57                        <?php echo bp_nouveau_the_group_meta( array( 'keys' => 'extra' ) ); ?>
    4458
    4559                </div><!-- .item-meta -->
    4660        <?php endif; ?>
  • src/bp-templates/bp-nouveau/common-styles/_bp_group_header.scss

    diff --git src/bp-templates/bp-nouveau/common-styles/_bp_group_header.scss src/bp-templates/bp-nouveau/common-styles/_bp_group_header.scss
    index a60670fba..56b13dedd 100644
     
    11// BP Single Group Header Styles.
    2 // @version 3.0.0
     2// @since 3.0.0
     3// @version 7.0.0
    34
    45.groups-header {
    56
    67        .bp-group-type-list {
     8
     9                @include font-size(18);
    710                margin: 0;
     11                color: $black;
     12                display: flex;
     13
     14                strong {
     15                        padding-right: $pad-med;
     16                        white-space: nowrap;
     17                }
    818        }
    919
    1020        .bp-feedback {
  • src/bp-templates/bp-nouveau/css/buddypress-rtl.css

    diff --git src/bp-templates/bp-nouveau/css/buddypress-rtl.css src/bp-templates/bp-nouveau/css/buddypress-rtl.css
    index d69e995d1..abe37caa7 100644
     
    11/*--------------------------------------------------------------
    22Hello, this is the BuddyPress Nouveau stylesheet.
    33
    4 @version 4.0.0
     4@since 3.0.0
     5@version 7.0.0
    56
    67----------------------------------------------------------------
    78>>> TABLE OF CONTENTS:
    body.no-js .single-item-header .js-self-profile-button { 
    23012302*-----------------------------------------------------
    23022303*/
    23032304.groups-header .bp-group-type-list {
     2305        font-size: 18px;
    23042306        margin: 0;
     2307        color: #333;
     2308        display: flex;
     2309}
     2310
     2311.groups-header .bp-group-type-list strong {
     2312        padding-left: 1em;
     2313        white-space: nowrap;
    23052314}
    23062315
    23072316.groups-header .bp-feedback {
  • src/bp-templates/bp-nouveau/css/buddypress.css

    diff --git src/bp-templates/bp-nouveau/css/buddypress.css src/bp-templates/bp-nouveau/css/buddypress.css
    index c80c057ce..b3df10a7e 100644
     
    11/*--------------------------------------------------------------
    22Hello, this is the BuddyPress Nouveau stylesheet.
    33
    4 @version 4.0.0
     4@since 3.0.0
     5@version 7.0.0
    56
    67----------------------------------------------------------------
    78>>> TABLE OF CONTENTS:
    body.no-js .single-item-header .js-self-profile-button { 
    23012302*-----------------------------------------------------
    23022303*/
    23032304.groups-header .bp-group-type-list {
     2305        font-size: 18px;
    23042306        margin: 0;
     2307        color: #333;
     2308        display: flex;
     2309}
     2310
     2311.groups-header .bp-group-type-list strong {
     2312        padding-right: 1em;
     2313        white-space: nowrap;
    23052314}
    23062315
    23072316.groups-header .bp-feedback {
  • src/bp-templates/bp-nouveau/includes/groups/classes.php

    diff --git src/bp-templates/bp-nouveau/includes/groups/classes.php src/bp-templates/bp-nouveau/includes/groups/classes.php
    index 3b68f8003..f57e81f87 100644
     
    33 * Groups classes
    44 *
    55 * @since 3.0.0
    6  * @version 3.0.0
     6 * @version 7.0.0
    77 */
    88
    99// Exit if accessed directly.
    class BP_Nouveau_Customizer_Group_Nav extends BP_Core_Nav { 
    376376                return $this->get_secondary( array( 'parent_slug' => $this->group->slug ) );
    377377        }
    378378}
     379
     380/**
     381 * Group template meta backwards compatibility class.
     382 *
     383 * @since 7.0.0
     384 */
     385class BP_Nouveau_Group_Meta {
     386        /**
     387         * Used to get the template meta used in Groups loop.
     388         *
     389         * @since 7.0.0
     390         * @var string $meta The template meta used in Groups loop.
     391         */
     392        public $meta = '';
     393
     394        /**
     395         * Magic getter.
     396         *
     397         * This exists specifically for supporting deprecated object vars.
     398         *
     399         * @since 7.0.0
     400         *
     401         * @param string $key
     402         * @return string
     403         */
     404        public function __get( $key = '' ) {
     405                /* translators: %s is the name of the function to use instead of the deprecated one */
     406                _doing_it_wrong( 'bp_nouveau_group_meta', sprintf( __( 'Please use %s instead', 'buddypress' ), 'bp_nouveau_the_group_meta( array( \'keys\' => \'' . $key . '\' ) )' ) , '7.0.0' );
     407
     408                // Backwards compatibility.
     409                return bp_nouveau_the_group_meta( array( 'keys' => $key, 'echo' => false ) );
     410        }
     411
     412        /**
     413         * Constructor
     414         *
     415         * @since 7.0.0
     416         */
     417        public function __construct() {
     418                // Backwards compatibility.
     419                $this->meta = bp_nouveau_the_group_meta( array( 'echo' => false ) );
     420        }
     421}
  • src/bp-templates/bp-nouveau/includes/groups/template-tags.php

    diff --git src/bp-templates/bp-nouveau/includes/groups/template-tags.php src/bp-templates/bp-nouveau/includes/groups/template-tags.php
    index 03a9f4255..4e2028956 100644
    function bp_nouveau_groups_manage_members_buttons( $args = array() ) { 
    10671067 * @return bool             True if the group has meta. False otherwise.
    10681068 */
    10691069function bp_nouveau_group_has_meta( $meta_key = '' ) {
    1070         $group_meta = bp_nouveau_get_group_meta();
    1071 
    10721070        if ( ! $meta_key ) {
    1073                 return (bool) $group_meta;
     1071                $meta_keys = array( 'status', 'count' );
     1072        } else {
     1073                $meta_keys = array( $meta_key );
    10741074        }
    10751075
    1076         return ! empty( $group_meta[ $meta_key ] );
     1076        $group_meta = bp_nouveau_get_group_meta( $meta_keys );
     1077        $group_meta = array_filter( $group_meta );
     1078
     1079        return ! empty( $group_meta );
    10771080}
    10781081
    10791082/**
    function bp_nouveau_group_has_meta( $meta_key = '' ) { 
    10841087 * @return bool True if the group has meta. False otherwise.
    10851088 */
    10861089function bp_nouveau_group_has_meta_extra() {
    1087         return (bool) bp_nouveau_get_hooked_group_meta();
     1090        return false !== bp_nouveau_get_hooked_group_meta();
    10881091}
    10891092
    10901093/**
    10911094 * Display the group meta.
    10921095 *
    10931096 * @since 3.0.0
     1097 * @deprecated 7.0.0 Use bp_nouveau_the_group_meta()
     1098 * @see bp_nouveau_the_group_meta()
    10941099 *
    10951100 * @return string HTML Output.
    10961101 */
    10971102function bp_nouveau_group_meta() {
    1098         $meta = bp_nouveau_get_group_meta();
     1103        _deprecated_function( __FUNCTION__, '7.0.0', 'bp_nouveau_the_group_meta()' );
     1104        $group_meta = new BP_Nouveau_Group_Meta();
    10991105
    11001106        if ( ! bp_is_group() ) {
    1101                 echo join( ' / ', array_map( 'esc_html', (array) $meta ) );
     1107                echo $group_meta->meta;
    11021108        } else {
     1109                return $group_meta;
     1110        }
     1111}
    11031112
    1104                 /*
    1105                  * Lets return an object not echo an array here for the single groups,
    1106                  * more flexible for the template!!?? ~hnla
    1107                  *
    1108                  * @todo Paul says that a function that prints and/or returns a value,
    1109                  * depending on global state, is madness. This needs changing.
    1110                  */
    1111                 return (object) bp_nouveau_get_group_meta();
     1113/**
     1114 * Outputs or returns the group meta(s).
     1115 *
     1116 * @since 7.0.0
     1117 *
     1118 * @param array $args {
     1119 *     Optional. An array of arguments.
     1120 *
     1121 *     @type array   $keys      The list of template meta keys.
     1122 *     @type string  $delimeter The delimeter to use in case there is more than
     1123 *                              one key to output.
     1124 *     @type boolean $echo      True to output the template meta value. False otherwise.
     1125 * }
     1126 * @return string HTML Output.
     1127 */
     1128function bp_nouveau_the_group_meta( $args = array() ) {
     1129        $r = bp_parse_args( $args, array(
     1130                'keys'      => array(),
     1131                'delimeter' => '/',
     1132                'echo'      => true,
     1133        ), 'nouveau_the_group_meta' );
     1134
     1135        $group_meta = (array) bp_nouveau_get_group_meta( $r['keys'] );
     1136
     1137        if ( ! $group_meta ) {
     1138                return;
    11121139        }
     1140
     1141        $meta = '';
     1142        if ( 1 < count( $group_meta ) ) {
     1143                $group_meta = array_filter( $group_meta );
     1144                $meta       = join( ' ' . $r['delimeter'] . ' ', array_map( 'esc_html', $group_meta ) );
     1145        } else {
     1146                $meta = reset( $group_meta );
     1147        }
     1148
     1149        if ( ! $r['echo'] ) {
     1150                return $meta;
     1151        }
     1152
     1153        echo $meta;
    11131154}
    11141155
    11151156        /**
    1116          * Get the group meta.
     1157         * Get the group template meta.
    11171158         *
    11181159         * @since 3.0.0
     1160         * @since 7.0.0 Adds the `$keys` parameter.
    11191161         *
    1120          * @return array The group meta.
     1162         * @param array $keys One or more template meta keys to populate with their values.
     1163         *                    Possible keys are `status`, `count`, `group_type_list`, `description`, `extra`.
     1164         * @return array      The corresponding group template meta values.
    11211165         */
    1122         function bp_nouveau_get_group_meta() {
    1123                 /*
    1124                  * @todo For brevity required approapriate markup is added here as strings
    1125                  * this needs to be either filterable or the function needs to be able to accept
    1126                  * & parse args!
    1127                  */
    1128                 $meta     = array();
    1129                 $is_group = bp_is_group();
     1166        function bp_nouveau_get_group_meta( $keys = array() ) {
     1167                $keys       = (array) $keys;
     1168                $group      = false;
     1169                $group_meta = array();
     1170                $is_group   = bp_is_group();
    11301171
    1131                 if ( ! empty( $GLOBALS['groups_template']->group ) ) {
     1172                if ( isset( $GLOBALS['groups_template']->group ) ) {
    11321173                        $group = $GLOBALS['groups_template']->group;
     1174                } else {
     1175                        $group = groups_get_current_group();
    11331176                }
    11341177
    1135                 if ( empty( $group->id ) ) {
    1136                         return $meta;
     1178                if ( ! $group ) {
     1179                        return '';
    11371180                }
    11381181
    1139                 if ( empty( $group->template_meta ) ) {
    1140                         // It's a single group
    1141                         if ( $is_group ) {
    1142                                         $meta = array(
    1143                                                 'status'          =>  bp_get_group_type(),
    1144                                                 'group_type_list' =>  bp_get_group_type_list(),
    1145                                                 'description'     =>  bp_get_group_description(),
    1146                                         );
     1182                if ( ! $keys && ! $is_group ) {
     1183                        $keys = array( 'status', 'count' );
     1184                }
    11471185
    1148                                 // Make sure to include hooked meta.
    1149                                 $extra_meta = bp_nouveau_get_hooked_group_meta();
     1186                foreach ( $keys as $key ) {
     1187                        switch ( $key ) {
     1188                                case 'status' :
     1189                                        $group_meta['status'] = bp_get_group_type( $group );
     1190                                        break;
    11501191
    1151                                 if ( $extra_meta ) {
    1152                                         $meta['extra'] = $extra_meta;
    1153                                 }
     1192                                case 'count' :
     1193                                        $group_meta['count'] = bp_get_group_member_count( $group );
     1194                                        break;
    11541195
    1155                         // We're in the groups loop
    1156                         } else {
    1157                                 $meta = array(
    1158                                         'status' => bp_get_group_type(),
    1159                                         'count'  => bp_get_group_member_count(),
    1160                                 );
    1161                         }
     1196                                case 'group_type_list' :
     1197                                        $group_meta['group_type_list'] = bp_get_group_type_list( $group->id );
     1198                                        break;
    11621199
    1163                         /**
    1164                          * Filter to add/remove Group meta.
    1165                          *
    1166                          * @since 3.0.0
    1167                          *
    1168                          * @param array  $meta     The list of meta to output.
    1169                          * @param object $group    The current Group of the loop object.
    1170                          * @param bool   $is_group True if a single group is displayed. False otherwise.
    1171                          */
    1172                         $group->template_meta = apply_filters( 'bp_nouveau_get_group_meta', $meta, $group, $is_group );
     1200                                case 'description' :
     1201                                        $group_meta['description'] = bp_get_group_description( $group );
     1202                                        break;
     1203
     1204                                case 'extra' :
     1205                                        $group_meta['extra'] = '';
     1206
     1207                                        if ( $is_group ) {
     1208                                                $group_meta['extra'] = bp_nouveau_get_hooked_group_meta();
     1209                                        }
     1210                                        break;
     1211                        }
    11731212                }
    11741213
    1175                 return $group->template_meta;
     1214                /**
     1215                 * Filter to add/remove Group template meta.
     1216                 *
     1217                 * @since 3.0.0
     1218                 *
     1219                 * @param array  $group_meta The list of meta to output.
     1220                 * @param object $group      The current Group of the loop object.
     1221                 * @param bool   $is_group   True if a single group is displayed. False otherwise.
     1222                 */
     1223                return apply_filters( 'bp_nouveau_get_group_meta', $group_meta, $group, $is_group );
    11761224        }
    11771225
    11781226/**
  • src/bp-templates/bp-nouveau/sass/buddypress.scss

    diff --git src/bp-templates/bp-nouveau/sass/buddypress.scss src/bp-templates/bp-nouveau/sass/buddypress.scss
    index 8eaa6305a..c6b005608 100644
     
    2626/*--------------------------------------------------------------
    2727Hello, this is the BuddyPress Nouveau stylesheet.
    2828
    29 @version 4.0.0
     29@since 3.0.0
     30@version 7.0.0
    3031
    3132----------------------------------------------------------------
    3233>>> TABLE OF CONTENTS: