Opened 14 years ago
Closed 12 years ago
#2782 closed enhancement (fixed)
Add filters to bp_core_time_since
Reported by: | aesqe | Owned by: | |
---|---|---|---|
Milestone: | 1.7 | Priority: | normal |
Severity: | normal | Version: | 1.5 |
Component: | Core | Keywords: | has-patch dev-feedback |
Cc: | aesqe@… |
Description
add a filter right at the beginning of bp_core_time_since function so it can be overridden by a custom one, or wrap it in function_exists.
something like this
$filter = apply_filters('bp_core_time_since', '', $older_date, $newer_date); if( '' != $filter ) return $filter;
thanks :)
Attachments (1)
Change History (6)
#2
@
14 years ago
- Keywords needs-patch added; time removed
- Milestone changed from Awaiting Review to Future Release
- Summary changed from bp_core_time_since override to Add filters to bp_core_time_since
#3
@
13 years ago
- Keywords has-patch dev-feedback added; needs-patch removed
- Severity set to normal
The patch adds two filters:
"bp_core_time_since_pre" and "bp_core_time_since_post"
One is for overriding the whole function, the other for filtering the final output of the function.
I'd really appreciate if this could be included in the next version, as I have my own time_since function which I use. Also, in Croatian, plural of numbered nouns can have more than one variant.
Thanks :)
I'm concerned by the lack of proper i18n support in this function for the order of the number and name. Is this a case of adding dummy gettext calls so the appropriate strings are generated in the pot file?
#3056 is slightly related.