Opened 11 years ago
Closed 10 years ago
#5533 closed enhancement (fixed)
BP_Group_Extension::display() should be passed the group_id
Reported by: | boonebgorges | Owned by: | boonebgorges |
---|---|---|---|
Milestone: | 2.2 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Groups | Keywords: | good-first-bug has-patch |
Cc: |
Description
This is for greater parity with settings_screen()
, etc. See http://buddypress.org/support/topic/groups-extension-api-question-troubleshooting/
Attachments (2)
Change History (10)
#4
@
10 years ago
- Keywords has-patch added
I stumbled into this ticket when i was playing with Group Extension API. Am i in the right track here with the patch?
Patch:
- Added new optional parameter
$group_id
indisplay()
function stub in theBP_Group_Extension
class - Modify
_display_hook()
to call new functioncall_display()
which then calldisplay()
while passing$group_id
#5
@
10 years ago
Yeah, this looks pretty good - thanks for the patch, fahmiadib! Any reason we can't just do $this->display( $this->group_id )
instead of call_user_func()
?
#6
@
10 years ago
After looking a little bit more, i agree with you. call_user_func()
is used to call function from string. I will submit another patch.
#7
@
10 years ago
- Owner set to boonebgorges
- Status changed from new to accepted
Nice - thanks, fahmiadib! This is going to cause PHP notices for plugins currently registering BP_Group_Extension::display()
methods when strict mode is enabled, but oh well, we have done this once before. Thanks for the patch!
For anyone looking to work on this:
BP_Group_Extension
class in bp-groups-classes.php with the new optional parameter.function display(
and add the optional parameter.display()
method is called by the_display_hook
method in this same class. Find out where this action is invoked from, and pass the Group ID to the action. And, clearly, you'll need to figure out the best way to get the Group ID, but finding where the method is called should help you figure out the best option.