Opened 8 years ago
Closed 6 years ago
#7244 closed feature request (fixed)
Add functions bp_get_group_avatar_url() and bp_get_group_cover_url()
Reported by: | mifr45 | Owned by: | boonebgorges |
---|---|---|---|
Milestone: | 5.0.0 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Groups | Keywords: | good-first-bug has-patch |
Cc: |
Description
Function bp_get_group_avatar_url()
<?php function bp_get_group_avatar_url($group_id = null){ if(!$group_id){ $group_id = bp_get_group_id(); } return bp_core_fetch_avatar(array('object' => 'group','item_id' => $group_id,'html'=>false)); } ?>
Function bp_get_group_cover_url()
<?php function bp_get_group_cover_url($group_id = null){ if(!$group_id){ $group_id = bp_get_group_id(); } return bp_attachments_get_attachment('url', array('object_dir' => 'groups','item_id' => $group_id)); } ?>
Attachments (1)
Change History (9)
#1
follow-up:
↓ 2
@
8 years ago
- Keywords needs-patch good-first-bug added
- Milestone changed from Awaiting Review to 2.7
- Owner set to DJPaul
- Status changed from new to assigned
#2
in reply to:
↑ 1
@
8 years ago
@DJPaul, thanks for review!
I think there can be a function that outputs URL to the HTML:
<?php function bp_group_cover_url(){ echo bp_get_group_cover_url(); } ?>
#3
@
8 years ago
- Owner DJPaul deleted
Relatively simple patch if anyone new wants to have a go at this.
#6
@
6 years ago
- Keywords has-patch added; needs-patch removed
Here's my suggestion to get URLs for the group's cover or avatar.
Note: See
TracTickets for help on using
tickets.
Hi @mifr45
Thank you for your first contribution to BuddyPress. The functions you suggest are good suggestions, especially for the cover image.
I'll get these in for BuddyPress 2.7 unless someone beats me to it.