[buddypress-trac] [BuddyPress Trac] #7343: Add the_group filter to allow group object modification

buddypress-trac noreply at wordpress.org
Wed Jun 21 17:03:06 UTC 2017

#7343: Add the_group filter to allow group object modification
 Reporter:  ninjew        |       Owner:  dcavins
     Type:  enhancement   |      Status:  accepted
 Priority:  normal        |   Milestone:  Under Consideration
Component:  Groups        |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  dev-feedback  |

Comment (by dcavins):

 Replying to [comment:7 boonebgorges]:
 > I'd prefer not to use `apply_filters()`. We have some implicit
 conventions (both here and in WP) about passing objects through filters:
 it tends to encourage plugin developers to pass their own objects back to
 the filter, which causes forward-compatibility problems. We could revisit
 this if our primary objects had interfaces that developers could rely on,
 but that's some way off.
 > Technically similar, but semantically more in-line with the rest of WP,
 is a `do_action()` call at the end of `BP_Groups_Group::populate()`.
 `the_bp_group` parallels WP in some ways, but `BP_Groups_Group` is called
 in places other than a loop, so let's steer clear of that naming
 convention. Maybe something like:
 > {{{
 > do_action( 'bp_groups_group', $this );
 > }}}
 > or 'bp_groups_group_populated' (idk)?

 Does `$this` need to be passed by reference here?

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7343#comment:9>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac

More information about the buddypress-trac mailing list