[buddypress-trac] [BuddyPress Trac] #6749: bp_get_group_avatar() needs to work outside the loop

buddypress-trac noreply at wordpress.org
Sun Aug 15 17:14:44 UTC 2021


#6749: bp_get_group_avatar() needs to work outside the loop
--------------------------------------+--------------------------
 Reporter:  slaFFik                   |       Owner:  espellcaste
     Type:  enhancement               |      Status:  assigned
 Priority:  normal                    |   Milestone:  10.0.0
Component:  Groups                    |     Version:  9.0.0
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |
--------------------------------------+--------------------------
Changes (by espellcaste):

 * keywords:  needs-patch => has-patch has-unit-tests
 * type:  defect (bug) => enhancement


Comment:

 This is the first patch, of a few more I'm sure, introducing the new
 helper function, `bp_get_group_from_param`, to grab a group using one of
 the identifiers: slug, ID, `BP_Groups_Group` which defaults to the current
 group in the `BP_Groups_Template` loop.

 This is a preliminary patch which accounts to:

 - creating the helper function
 - updating a few functions to use this new function (more needs to be
 updated)
 - adding basic support to unit tests (support will be improved in future
 patches)

 Some notes:

 - PHPDoc was updated to remove references of getting the ID from the
 current loop;
 - `bp_group_is_visible` was updated to check against a specific user ID;
 - `bp_get_group_avatar` was updated to pass other parameter to
 `bp_core_fetch_avatar` which were missing.

 The goal is to gather preliminary feedback before diving even deeper. =P

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6749#comment:7>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list