WordPress.org

Make WordPress Core

Ticket #27271: 27271.diff

File 27271.diff, 623 bytes (added by MikeHansenMe, 6 years ago)

Add filter and brackets

  • src/wp-includes/formatting.php

     
    23112311 * @return string Human readable time difference.
    23122312 */
    23132313function human_time_diff( $from, $to = '' ) {
    2314         if ( empty( $to ) )
     2314        if ( empty( $to ) ) {
    23152315                $to = time();
     2316        }
    23162317
    23172318        $diff = (int) abs( $to - $from );
    23182319
     
    23492350                $since = sprintf( _n( '%s year', '%s years', $years ), $years );
    23502351        }
    23512352
    2352         return $since;
     2353        return apply_filters( 'human_time_diff', $since, $diff );
    23532354}
    23542355
    23552356/**