human_time_diff
Filters the human-readable difference between two timestamps.
Usage
add_filter( 'human_time_diff', 'wp_kama_human_time_diff_filter', 10, 4 ); /** * Function for `human_time_diff` filter-hook. * * @param string $since The difference in human-readable text. * @param int $diff The difference in seconds. * @param int $from Unix timestamp from which the difference begins. * @param int $to Unix timestamp to end the time difference. * * @return string */ function wp_kama_human_time_diff_filter( $since, $diff, $from, $to ){ // filter... return $since; }
- $since(string)
- The difference in human-readable text.
- $diff(int)
- The difference in seconds.
- $from(int)
- Unix timestamp from which the difference begins.
- $to(int)
- Unix timestamp to end the time difference.
Changelog
Since 4.0.0 | Introduced. |
Where the hook is called
human_time_diff
wp-includes/formatting.php 3936
return apply_filters( 'human_time_diff', $since, $diff, $from, $to );