bp_group_list_parents( object|bool $group = false )
Output markup listing group parents.
Description
Parameters
- $group
-
(Optional) Group object. Default: current group in loop.
Default value: false
Source
File: bp-groups/bp-groups-template.php
function bp_group_list_parents( $group = false ) {
global $groups_template;
if ( empty( $group ) ) {
$group =& $groups_template->group;
}
if ( ! empty( $group->parent_id ) ) {
$parent_group = groups_get_group( $group->parent_id );
$group_type = bp_groups_get_group_type( $group->parent_id );
$group_type_object = bp_groups_get_group_type_object( $group_type );
$group_type = ( isset( $group_type_object ) && isset( $group_type_object->labels['singular_name'] ) ) ?: esc_html__( 'Subgroup of', 'buddyboss' );
?>
<dl class="parent-list">
<dt class="parent-title"><?php echo $group_type; ?></dt>
<dd class="group-list parent">
<ul id="group-parent">
<li>
<a href="<?php bp_group_permalink( $parent_group ) ?>" class="bp-tooltip" data-bp-tooltip-pos="up"
data-bp-tooltip="<?php printf( ( '%s' ), bp_get_group_name( $parent_group ) ) ?>"><?php echo bp_core_fetch_avatar( array(
'item_id' => $parent_group->id,
'object' => 'group',
'alt' => sprintf( __( 'Group photo of %s', 'buddyboss' ), bp_get_group_name( $parent_group ) )
) ) ?></a>
</li>
</ul>
</dd>
</dl>
<?php }
}
Changelog
| Version | Description |
|---|---|
| BuddyBoss 1.0.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.