Make WordPress Core

Ticket #29849: 29849-codebase-replacements.diff

File 29849-codebase-replacements.diff, 4.7 KB (added by akirk, 10 years ago)
  • src/wp-admin/includes/class-wp-media-list-table.php

     
    402402                        $m_time = $post->post_date;
    403403                        $time = get_post_time( 'G', true, $post, false );
    404404                        if ( ( abs( $t_diff = time() - $time ) ) < DAY_IN_SECONDS ) {
    405                                 if ( $t_diff < 0 ) {
    406                                         $h_time = sprintf( __( '%s from now' ), human_time_diff( $time ) );
    407                                 } else {
    408                                         $h_time = sprintf( __( '%s ago' ), human_time_diff( $time ) );
    409                                 }
     405                                $h_time = wp_natural_time( $time );
    410406                        } else {
    411407                                $h_time = mysql2date( __( 'Y/m/d' ), $m_time );
    412408                        }
  • src/wp-admin/includes/class-wp-plugin-install-list-table.php

     
    514514                                </div>
    515515                                <div class="column-updated">
    516516                                        <strong><?php _e( 'Last Updated:' ); ?></strong> <span title="<?php echo esc_attr( date_i18n( $date_format, $last_updated_timestamp ) ); ?>">
    517                                                 <?php printf( __( '%s ago' ), human_time_diff( $last_updated_timestamp ) ); ?>
     517                                                <?php echo wp_natural_time( $last_updated_timestamp ); ?>
    518518                                        </span>
    519519                                </div>
    520520                                <div class="column-downloaded">
  • src/wp-admin/includes/class-wp-posts-list-table.php

     
    792792                        $time_diff = time() - $time;
    793793
    794794                        if ( $time_diff > 0 && $time_diff < DAY_IN_SECONDS ) {
    795                                 $h_time = sprintf( __( '%s ago' ), human_time_diff( $time ) );
     795                                $h_time = wp_natural_time( $time );
    796796                        } else {
    797797                                $h_time = mysql2date( __( 'Y/m/d' ), $m_time );
    798798                        }
  • src/wp-admin/includes/plugin-install.php

     
    463463                        <li><strong><?php _e( 'Author:' ); ?></strong> <?php echo links_add_target( $api->author, '_blank' ); ?></li>
    464464                <?php } if ( ! empty( $api->last_updated ) ) { ?>
    465465                        <li><strong><?php _e( 'Last Updated:' ); ?></strong> <span title="<?php echo esc_attr( date_i18n( $date_format, $last_updated_timestamp ) ); ?>">
    466                                 <?php printf( __( '%s ago' ), human_time_diff( $last_updated_timestamp ) ); ?>
     466                                <?php echo wp_natural_time( $last_updated_timestamp ); ?>
    467467                        </span></li>
    468468                <?php } if ( ! empty( $api->requires ) ) { ?>
    469469                        <li><strong><?php _e( 'Requires WordPress Version:' ); ?></strong> <?php printf( __( '%s or higher' ), $api->requires ); ?></li>
  • src/wp-admin/includes/revision.php

     
    205205                        'author'     => $authors[ $revision->post_author ],
    206206                        'date'       => date_i18n( __( 'M j, Y @ H:i' ), $modified ),
    207207                        'dateShort'  => date_i18n( _x( 'j M @ H:i', 'revision date short format' ), $modified ),
    208                         'timeAgo'    => sprintf( __( '%s ago' ), human_time_diff( $modified_gmt, $now_gmt ) ),
     208                        'timeAgo'    => wp_natural_time( $modified_gmt, $now_gmt ),
    209209                        'autosave'   => $autosave,
    210210                        'current'    => $current,
    211211                        'restoreUrl' => $can_restore ? $restore_link : false,
     
    223223                        'author'     => $authors[ $post->post_author ],
    224224                        'date'       => date_i18n( __( 'M j, Y @ H:i' ), strtotime( $post->post_modified ) ),
    225225                        'dateShort'  => date_i18n( _x( 'j M @ H:i', 'revision date short format' ), strtotime( $post->post_modified ) ),
    226                         'timeAgo'    => sprintf( __( '%s ago' ), human_time_diff( strtotime( $post->post_modified_gmt ), $now_gmt ) ),
     226                        'timeAgo'    => wp_natural_time( $post->post_modified_gmt, $now_gmt ),
    227227                        'autosave'   => false,
    228228                        'current'    => true,
    229229                        'restoreUrl' => false,
     
    375375                <# }); #>
    376376                </div>
    377377        </script><?php
    378 }
    379  No newline at end of file
     378}
  • src/wp-includes/post-template.php

     
    18031803                _x( '%1$s %2$s, %3$s ago (%4$s)', 'post revision title' ),
    18041804                $gravatar,
    18051805                $author,
    1806                 human_time_diff( strtotime( $revision->post_modified ), current_time( 'timestamp' ) ),
     1806                wp_natural_time( $revision->post_modified, current_time( 'timestamp' ) ),
    18071807                $date
    18081808        );
    18091809