Opened 10 years ago
Closed 7 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 |
|---|---|---|---|
| Priority: | normal | Milestone: | 5.0.0 |
| Component: | Groups | Version: | |
| Severity: | normal | 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
@
10 years ago
- Keywords needs-patch good-first-bug added
- Milestone Awaiting Review → 2.7
- Owner set to
- Status new → assigned
#2
in reply to: ↑ 1
@
10 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(); } ?>
#6
@
7 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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.