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

buddypress-trac noreply at wordpress.org
Thu Apr 20 16:07:07 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  |
--------------------------+----------------------------------
Changes (by dcavins):

 * owner:   => dcavins
 * status:  new => accepted


Comment:

 Hi @ninjew-

 This is an interesting idea. The groups in the `$groups_template` are
 populated using `groups_get_groups()` which offers several filter options:
 https://buddypress.trac.wordpress.org/browser/branches/2.8/src/bp-groups
 /bp-groups-functions.php#L701

 Could you filter the group objects there? Maybe in combination with a
 `bp_is_groups_directory()` scoping check?

 Other notes: `the_post` filter occurs in WP_Query::setup_postdata():
 https://core.trac.wordpress.org/browser/branches/4.7/src/wp-includes
 /class-wp-query.php#L3975

 Which seems more like filtering `groups_get_group` to me. @boonebgorges,
 what about instead of using `new BP_Groups_Group( $id )` here:
 https://buddypress.trac.wordpress.org/browser/branches/2.8/src/bp-
 groups/classes/class-bp-groups-group.php#L1164
 we called `groups_get_group( $id )`, which would apply the
 `groups_get_group` filter to each group object?

 -David

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


More information about the buddypress-trac mailing list