Skip to:

Opened 8 years ago

Closed 5 years ago

#7244 closed feature request (fixed)

Add functions bp_get_group_avatar_url() and bp_get_group_cover_url()

Reported by: mifr45's profile mifr45 Owned by: boonebgorges's profile boonebgorges
Milestone: 5.0.0 Priority: normal
Severity: normal Version:
Component: Groups Keywords: good-first-bug has-patch


Function bp_get_group_avatar_url()

function bp_get_group_avatar_url($group_id = null){
                        $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()

function bp_get_group_cover_url($group_id = null){
                        $group_id = bp_get_group_id();
                return bp_attachments_get_attachment('url', array('object_dir' => 'groups','item_id' => $group_id));

Attachments (1)

7244.patch (1.9 KB) - added by truchot 5 years ago.

Download all attachments as: .zip

Change History (9)

#1 follow-up: @DJPaul
7 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

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.

#2 in reply to: ↑ 1 @mifr45
7 years ago

@DJPaul, thanks for review!
I think there can be a function that outputs URL to the HTML:

function bp_group_cover_url(){
echo bp_get_group_cover_url();

#3 @DJPaul
7 years ago

  • Owner DJPaul deleted

Relatively simple patch if anyone new wants to have a go at this.

#4 @mercime
7 years ago

  • Milestone changed from 2.7 to Future Release

#5 @slaFFik
7 years ago

  • Version 2.6.3 deleted

#6 @truchot
5 years ago

  • Keywords has-patch added; needs-patch removed

Here's my suggestion to get URLs for the group's cover or avatar.

5 years ago

#7 @imath
5 years ago

  • Milestone changed from Awaiting Contributions to 5.0.0

Welcome @truchot !!

Thanks a lot for this first patch
Let's try to have this in for 5.0.0.

Last edited 5 years ago by imath (previous) (diff)

#8 @boonebgorges
5 years ago

  • Owner set to boonebgorges
  • Resolution set to fixed
  • Status changed from assigned to closed

In 12362:

Introduce functions to fetch group avatar and cover image URLs.

Props truchot.
Fixes #7244.

Note: See TracTickets for help on using tickets.