Ticket #32386: 32386.3.diff
File 32386.3.diff, 2.5 KB (added by , 10 years ago) |
---|
-
src/wp-admin/includes/class-wp-posts-list-table.php
819 819 820 820 case 'date': 821 821 if ( '0000-00-00 00:00:00' == $post->post_date ) { 822 $t_time = $h_time = __( 'Unpublished' ); 823 $time_diff = 0; 824 } else { 825 $t_time = get_the_time( __( 'Y/m/d g:i:s a' ) ); 826 $m_time = $post->post_date; 827 $time = get_post_time( 'G', true, $post ); 828 829 $time_diff = time() - $time; 822 printf( '<td %s>%s</td>', $attributes, __( 'Unpublished' ) ); 823 break; 824 } 830 825 831 if ( $time_diff > 0 && $time_diff < DAY_IN_SECONDS ) 832 $h_time = sprintf( __( '%s ago' ), human_time_diff( $time ) ); 833 else 834 $h_time = mysql2date( __( 'Y/m/d' ), $m_time ); 826 if ( 'draft' == $post->post_status ) { 827 $time = get_the_modified_time( __( 'Y/m/d g:i:s a' ) ); 828 $time_gmt = get_post_modified_time( 'G', true, $post ); 829 } else { 830 $time = get_the_time( __( 'Y/m/d g:i:s a' ) ); 831 $time_gmt = get_post_time( 'G', true, $post ); 835 832 } 836 833 834 $time_diff = time() - $time_gmt; 835 837 836 echo '<td ' . $attributes . '>'; 838 837 if ( 'excerpt' == $mode ) { 839 838 … … 846 845 * 847 846 * @since 2.5.1 848 847 * 849 * @param array $t_timeThe published time.848 * @param string $time The published time. 850 849 * @param WP_Post $post Post object. 851 850 * @param string $column_name The column name. 852 851 * @param string $mode The list display mode ('excerpt' or 'list'). 853 852 */ 854 echo apply_filters( 'post_date_column_time', $t _time, $post, $column_name, $mode );853 echo apply_filters( 'post_date_column_time', $time, $post, $column_name, $mode ); 855 854 } else { 856 855 856 if ( $time_diff > 0 && $time_diff < DAY_IN_SECONDS ) { 857 $time_abbr = sprintf( __( '%s ago' ), human_time_diff( $time_gmt ) ); 858 } else { 859 $time_abbr = mysql2date( __( 'Y/m/d' ), $time ); 860 } 861 857 862 /** This filter is documented in wp-admin/includes/class-wp-posts-list-table.php */ 858 echo '<abbr title="' . $t _time . '">' . apply_filters( 'post_date_column_time', $h_time, $post, $column_name, $mode ) . '</abbr>';863 echo '<abbr title="' . $time . '">' . apply_filters( 'post_date_column_time', $time_abbr, $post, $column_name, $mode ) . '</abbr>'; 859 864 } 860 865 echo '<br />'; 861 866 if ( 'publish' == $post->post_status ) {