WordPress.org

Make WordPress Core


Ignore:
Timestamp:
06/05/2014 12:38:33 AM (6 years ago)
Author:
SergeyBiryukov
Message:

Add a filter to human_time_diff().

props slimndap.
fixes #27271.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/formatting.php

    r28444 r28670  
    23362336 */
    23372337function human_time_diff( $from, $to = '' ) {
    2338     if ( empty( $to ) )
     2338    if ( empty( $to ) ) {
    23392339        $to = time();
     2340    }
    23402341
    23412342    $diff = (int) abs( $to - $from );
     
    23742375    }
    23752376
    2376     return $since;
     2377    /**
     2378     * Filter the human readable difference between two timestamps.
     2379     *
     2380     * @since 4.0.0
     2381     *
     2382     * @param string $since The difference in human readable text.
     2383     * @param int    $diff  The difference in seconds.
     2384     * @param int    $from  Unix timestamp from which the difference begins.
     2385     * @param int    $to    Unix timestamp to end the time difference.
     2386     */
     2387    return apply_filters( 'human_time_diff', $since, $diff, $from, $to );
    23772388}
    23782389
Note: See TracChangeset for help on using the changeset viewer.