Skip to:

Opened 7 years ago

Closed 5 years ago

#7654 closed enhancement (wontfix)

Suggestion of bp_core_get_* functions to the Core component

Reported by: espellcaste's profile espellcaste Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Core Keywords: needs-patch dev-feedback


While working on wp-cli-buddypress, I saw the need for a few core functions. I'd like to suggest those to BuddyPress. They are:

bp_core_get_inactive_components() (inactive, aka deactivated)

Attachments (2)

7654-1.diff (2.4 KB) - added by espellcaste 7 years ago.
7654-2.diff (5.9 KB) - added by DJPaul 6 years ago.

Download all attachments as: .zip

Change History (9)

7 years ago

#1 @espellcaste
7 years ago

  • Keywords has-patch added

#2 @DJPaul
7 years ago

  • Keywords needs-patch added; has-patch removed

Not against this in principle, but there are more places internally (in the core code, and in the phpunit tests) where these settings are referred to. Everything would need to use the new functions provided by your patch if we're going to merge this in.

Last edited 7 years ago by DJPaul (previous) (diff)

#3 @espellcaste
6 years ago

Working on an update...

6 years ago

#4 @DJPaul
6 years ago

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().

#5 @DJPaul
6 years ago

  • Keywords dev-feedback added

#6 @DJPaul
6 years ago

  • Milestone changed from 3.0 to Awaiting Contributions

#7 @espellcaste
5 years ago

  • Milestone Awaiting Contributions deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Agree @DJPaul!

After a while, the idea was good but I run into the same problems as you. I'd rather keep it as it is and focus on more important BuddyPress problem.

Thanks for taking the time though! :)

Note: See TracTickets for help on using tickets.