[buddypress-trac] [BuddyPress Trac] #7654: Suggestion of bp_core_get_* functions to the Core component
buddypress-trac
noreply at wordpress.org
Mon Mar 5 10:13:08 UTC 2018
#7654: Suggestion of bp_core_get_* functions to the Core component
-------------------------+------------------
Reporter: espellcaste | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 3.0
Component: Core | Version:
Severity: normal | Resolution:
Keywords: needs-patch |
-------------------------+------------------
Comment (by DJPaul):
I spent about two hours looking at this. 7654-2.diff is not ready or even
correct, but I wanted to save what I had done.
I found a challenge when auditing the `bootstrap()` method in the main
BuddyPress loader class. Basically, should these methods return the
database option, or touch the globals as configured in `bootstrap()`?
`bp_core_get_components()` is a example of a function used in the admin UI
which returns hardcoded values, but could easily be switch to touch one of
the above instead.
I also felt a need for e.g. `bp_core_get_optional_components()`, but while
this project is arguably over fond of functions that wrap functions, we
already have `bp_core_get_components($component_type)` which could be used
instead of these individual functions, if we wanted to.
My gut feeling is that we should keep the duplicate filter calls in
`bootstrap()` which set the global `$bp` properties, have (and add) the
documented filters in `bp_core_get_components()` return from the global
`$bp` properties -- rather than the database options -- and then consider
if we need really need wrapper functions that just call
`bp_core_get_components()`.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7654#comment:4>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list