#3184 closed defect (bug) (fixed)
Intercept API
| Reported by: | johnjamesjacoby | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 2.6 |
| Component: | General | Version: | 2.0 |
| Severity: | normal | Keywords: | 2nd-opinion close |
| Cc: |
Description
There are some specific places in bbPress where the ability to short circuit specific function calls has been implemented over the years. These are usually queries, counts, or freshness; places where the functionality isn't desirable or doesn't scale to millions of topics.
Namely, their return values range from strings to null, and there is no real pattern to them. There is also a WordPress Core issue that talks about this.
Let's introduce our own intercept handlers to simplify these unique areas of bbPress a bit, and come up with a common language for future implementations.
Change History (7)
#3
@
9 years ago
2 filters were removed in this ticket.
bbp_pre_format_activity_action_new_postbbp_pre_add_stick_topics
They will now be turned into:
pre_bbp_format_activity_action_new_postpre_bbp_add_sticky_topics
These were new in 2.6, and stick should have been sticky, so was wrong anyways.
I'm not anticipating any problems with these renames, as nothing on the web or in the plugin repo were using them.
#4
follow-up:
↓ 5
@
9 years ago
- Keywords 2nd-opinion close added; commit removed
Paging @jmdodd and @netweb for a sanity check on this before closing.
#5
in reply to: ↑ 4
;
follow-up:
↓ 6
@
9 years ago
Replying to johnjamesjacoby:
Paging @jmdodd and @netweb for a sanity check on this before closing.
Looks good to me 👍🏼
Groking back compat took a bit, for example, the user templates changes in [6751], the existing filter names will remain for those functions and any new addition would use pre_bbp_function_name.
As such if someone were to use pre_bbp_get_favorites_permalink this wouldn't work as they'd need to continue using bbp_pre_get_favorites_permalink
#6
in reply to: ↑ 5
@
9 years ago
- Resolution → fixed
- Status new → closed
Replying to netweb:
Groking back compat took a bit, for example, the user templates changes in [6751], the existing filter names will remain for those functions and any new addition would use
pre_bbp_function_name.
As such if someone were to use
pre_bbp_get_favorites_permalinkthis wouldn't work as they'd need to continue usingbbp_pre_get_favorites_permalink
Yeah; @jmdodd had the same response initially also. It's more clever than I normally like, but it's the cleanest way I could think to maintain backwards compatibility without including an additional third function parameter (or something worse.)
Thanks for looking. Closing this as fixed for 2.6.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
In 6751: