bp_nouveau_get_group_meta( array $keys = array() )
Get the group template meta.
Parameters Parameters
- $keys
-
(array) (Optional) One or more template meta keys to populate with their values. Possible keys are
status
,count
,group_type_list
,description
,extra
.Default value: array()
Return Return
(array) The corresponding group template meta values.
Source Source
File: bp-templates/bp-nouveau/includes/groups/template-tags.php
function bp_nouveau_get_group_meta( $keys = array() ) { $keys = (array) $keys; $group = false; $group_meta = array(); $is_group = bp_is_group(); if ( isset( $GLOBALS['groups_template']->group ) ) { $group = $GLOBALS['groups_template']->group; } else { $group = groups_get_current_group(); } if ( ! $group ) { return ''; } if ( ! $keys && ! $is_group ) { $keys = array( 'status', 'count' ); } foreach ( $keys as $key ) { switch ( $key ) { case 'status' : $group_meta['status'] = bp_get_group_type( $group ); break; case 'count' : $group_meta['count'] = bp_get_group_member_count( $group ); break; case 'group_type_list' : $group_meta['group_type_list'] = bp_get_group_type_list( $group->id ); break; case 'description' : $group_meta['description'] = bp_get_group_description( $group ); break; case 'extra' : $group_meta['extra'] = ''; if ( $is_group ) { $group_meta['extra'] = bp_nouveau_get_hooked_group_meta(); } break; } } /** * Filter to add/remove Group template meta. * * @since 3.0.0 * * @param array $group_meta The list of meta to output. * @param object $group The current Group of the loop object. * @param bool $is_group True if a single group is displayed. False otherwise. */ return apply_filters( 'bp_nouveau_get_group_meta', $group_meta, $group, $is_group ); }
Expand full source code Collapse full source code View on Trac
Changelog Changelog
Version | Description |
---|---|
7.0.0 | Adds the $keys parameter. |
3.0.0 | Introduced. |