human_time_diff хук-фильтрWP 4.0.0

Filters the human readable difference between two timestamps.

Использование

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(строка)
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.

Список изменений

С версии 4.0.0 Введена.

Где вызывается хук

human_time_diff()
human_time_diff
wp-includes/formatting.php 3848
return apply_filters( 'human_time_diff', $since, $diff, $from, $to );

Где используется хук в WordPress

Использование не найдено.