[buddypress-trac] [BuddyPress Trac] #6997: Add item ID to bp_get_member|group_class() filters

buddypress-trac noreply at wordpress.org
Tue Apr 5 18:52:31 UTC 2016


#6997: Add item ID to bp_get_member|group_class() filters
-------------------------------------+------------------
 Reporter:  Offereins                |       Owner:
     Type:  enhancement              |      Status:  new
 Priority:  normal                   |   Milestone:  2.6
Component:  Component - Members      |     Version:
 Severity:  normal                   |  Resolution:
 Keywords:  needs-patch 2nd-opinion  |
-------------------------------------+------------------
Changes (by boonebgorges):

 * keywords:  has-patch 2nd-opinion => needs-patch 2nd-opinion


Comment:

 > touching globals is unfavorable, to say the least.

 I agree with this. I've generally advocated with *not* adding the values
 to the filters just to avoid code churn, but I could easily be persuaded
 otherwise.

 As noted in the chat, I think, on balance, that it would be preferable to
 pass the member object (group object, etc) to the filter rather than the
 ID. But this introduces its own complications, such as the fact that, as
 far as I know, `$members_template->member` is a `stdClass` object and not
 something with proper structure. In any case, we should be consistent.

 @Offereins If you want to take this up as a project, I'd encourage you to
 look through the `bp-*-template.php` files to get a sense of what the
 general strategy should be. For example, if there are lots of places where
 we're already passing IDs to filters in these sorts of functions, then
 maybe we should continue using IDs. Once we have broad decisions made,
 someone will need to begin generating patches, maybe one component at a
 time. These patches should include the necessary filter documentation
 changes (`@since` and `@param`).

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


More information about the buddypress-trac mailing list