[wp-trac] [WordPress Trac] #27271: Add a filter to human_time_diff()
WordPress Trac
noreply at wordpress.org
Tue Mar 4 16:04:20 UTC 2014
#27271: Add a filter to human_time_diff()
-------------------------+-----------------------------
Reporter: slimndap | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Formatting | Version: 3.8.1
Severity: normal | Keywords:
Focuses: template |
-------------------------+-----------------------------
The human_time_diff function lacks a filter.
It would be useful to add extra formatting options.
Currently, if the difference is 2 hours and 40 minutes the result of
human_time_diff is '2 hours'.
With a filter you could change it to be more specific: 2 hours, 40 mins.
The filter could look like this:
{{{
return apply_filters( 'human_time_diff', $since, $diff );
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/27271>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list