human_time_diff
Filter HookDescription
Filters the human-readable difference between two timestamps.Hook Information
File Location |
wp-includes/formatting.php
View on GitHub
|
Hook Type | Filter |
Line Number | 3940 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$since
|
The difference in human-readable text. |
int
|
$diff
|
The difference in seconds. |
int
|
$from
|
Unix timestamp from which the difference begins. |
int
|
$to
|
Unix timestamp to end the time difference. |
Usage Examples
Basic Usage
<?php
// Hook into human_time_diff
add_filter('human_time_diff', 'my_custom_filter', 10, 4);
function my_custom_filter($since, $diff, $from, $to) {
// Your custom filtering logic here
return $since;
}
Source Code Context
wp-includes/formatting.php:3940
- How this hook is used in WordPress core
<?php
3935 * @param string $since The difference in human-readable text.
3936 * @param int $diff The difference in seconds.
3937 * @param int $from Unix timestamp from which the difference begins.
3938 * @param int $to Unix timestamp to end the time difference.
3939 */
3940 return apply_filters( 'human_time_diff', $since, $diff, $from, $to );
3941 }
3942
3943 /**
3944 * Generates an excerpt from the content, if needed.
3945 *
PHP Documentation
<?php
/**
* Filters the human-readable difference between two timestamps.
*
* @since 4.0.0
*
* @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.
*/
Quick Info
- Hook Type: Filter
- Parameters: 4
- File: wp-includes/formatting.php
Related Hooks
Related hooks will be displayed here in future updates.