-
-
Save toluaddy/b1e4603dc3d7927d07a8689972ba75c5 to your computer and use it in GitHub Desktop.
BuddyPress: Default Group Avatar
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
function sc_bp_default_group_avatar($avatar) { | |
global $bp, $groups_template; | |
if(strpos($avatar,'group-avatars')) : | |
return $avatar; | |
else : | |
$default = get_bloginfo('template_directory') .'/asset/img/default/group.png'; | |
if($bp->current_action == "") : | |
return '<img class="avatar" alt="'. $groups_template->group->name.'" src="'.$default.'">'; | |
else : | |
return '<img class="avatar" alt="'. $groups_template->group->name.'" src="'.$default.'">'; | |
endif; | |
endif; | |
} | |
add_filter('bp_get_group_avatar', 'sc_bp_default_group_avatar'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment