Opened 3 years ago
Closed 3 years ago
#8943 closed task (fixed)
Group Extension using a function to set their tab visibility & the BP Rewrites API
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 12.0.0 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Groups | Keywords: | has-patch |
| Cc: |
Description
Working on making bbPress ready for 12.0, I realized the way the $show_tab_callback property added to the BP_Group_Extension class during the Rewrites migrate process (see #4954) was wrong.
Plugins extending BP_Group_Extension & using a function to set their $show_tab argument will now need to use the $show_tab_callback arg instead when initing their extension using parent::init( $args ).
A function callback needs to be passed within this $show_tab_callback so that it is called once the current/displayed Groups single item is defined by BuddyPress.
This wasn't necessary in previous versions of BuddyPress because this single item was defined very early.
Improve how the group tab display is performed to take in account Plugins using a function to set its visibility.
Trac ticket: https://buddypress.trac.wordpress.org/ticket/8943