human_time_diff WordPress Filter Hook

The human_time_diff hook allows you to display the difference between two dates in a human readable format. This is useful for displaying the time since a post was published, or the time until a post is scheduled to be published.

apply_filters( 'human_time_diff', string $since, int $diff, int $from, int $to ) #

Filters the human readable difference between two timestamps.


Parameters

$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.


Top ↑

Source

File: wp-includes/formatting.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More