Created
November 23, 2021 05:14
-
-
Save GLWalker/e20c5dede1015c8ea473c6d9cbb7912d to your computer and use it in GitHub Desktop.
BuddyPress Group Admin's Output with Boostrap 5 css classes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Output markup listing group admins. | |
* | |
* @since 1.0.0 | |
* | |
* @param object|bool $group Optional. Group object. | |
* Default: current group in loop. | |
*/ | |
function systmp_bp_group_list_admins($group = false) | |
{ | |
global $groups_template; | |
if (empty($group)) { | |
$group = &$groups_template->group; | |
} | |
if (!empty($group->admins)) { ?> | |
<ul id="group-admins" class="d-flex list-unstyled mt-auto"> | |
<?php foreach ((array) $group->admins as $admin) { ?> | |
<li class="m-2"> | |
<a href=" <?php echo bp_core_get_user_domain($admin->user_id, $admin->user_nicename, $admin->user_login) ?>" data-bs-toggle="tooltip" title="<?php printf(('%s'), bp_core_get_user_displayname($admin->user_id)); ?>" aria-label="<?php printf(('%s'), bp_core_get_user_displayname($admin->user_id)); ?>"> | |
<?php | |
echo bp_core_fetch_avatar( | |
array( | |
'item_id' => $admin->user_id, | |
'email' => $admin->user_email, | |
'class' => 'rounded border border-1', | |
'alt' => sprintf( | |
/* translators: %s: member name */ | |
__('Profile picture of %s', 'buddypress'), | |
bp_core_get_user_displayname($admin->user_id) | |
), | |
) | |
); | |
?> | |
</a> | |
</li> | |
<?php } ?> | |
</ul> | |
<?php } else { ?> | |
<span class="activity"><?php _e('No Admins', 'buddypress') ?></span> | |
<?php } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment