[buddypress-trac] [BuddyPress Trac] #8558: Adapt Group extensions registration to BP Rewrites

buddypress-trac noreply at wordpress.org
Fri Aug 27 13:44:17 UTC 2021


#8558: Adapt Group extensions registration to BP Rewrites
--------------------------+-----------------------
 Reporter:  imath         |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  10.0.0
Component:  Groups        |    Version:  1.1
 Severity:  normal        |   Keywords:  has-patch
--------------------------+-----------------------
 I suggest to move the `bp_register_group_extension()` function from the
 `BP_Group_Extension` class file to the `src/bp-groups/bp-groups-
 functions.php` file.

 Using an anonymous function inside the `bp_register_group_extension()`
 function to init Group Extensions at `bp_init` is problematic.

 1. I suggest to only use this function to register Group Extension
 classnames into a specific global (for now! I plan to extend this from the
 BP Rewrites plugin to manage slug customizations).
 2. And use a new function (`bp_init_group_extensions()`) to init the Group
 Extensions by looping into this specific global.

 It seems to have no regression effects according to my manual tests, and
 PHPUnit tests are not failing.

 Unless one of us feels strongly about this change, I'm pretty confident
 about it so I'll commit it soon to carry on progressing on BP Rewrites.

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/8558>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list