WordPress.org

Make WordPress Core

Ticket #26502: 26502.diff

File 26502.diff, 774 bytes (added by GaryJ, 6 years ago)

Show date if timestamp difference is greater than 1 year

  • wp-admin/includes/dashboard.php

     
    593593                                $relative = __( 'Today' );
    594594                        } elseif ( date( 'Y-m-d', $time ) == $tomorrow ) {
    595595                                $relative = __( 'Tomorrow' );
     596                        } elseif ( absint( $time - current_time( 'timestamp' ) ) > YEAR_IN_SECONDS ) {
     597                                /* translators: date and time format for distant recent posts on the dashboard, see http://php.net/date */
     598                                $relative = date_i18n( __( 'M jS Y' ), $time );
    596599                        } else {
    597600                                /* translators: date and time format for recent posts on the dashboard, see http://php.net/date */
    598601                                $relative = date_i18n( __( 'M jS' ), $time );