- Timestamp:
- 06/01/2020 07:13:54 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-posts-list-table.php
r47808 r47879 1066 1066 if ( '0000-00-00 00:00:00' === $post->post_date ) { 1067 1067 $t_time = __( 'Unpublished' ); 1068 $h_time = $t_time;1069 1068 $time_diff = 0; 1070 1069 } else { 1071 $t_time = get_the_time( __( 'Y/m/d g:i:s a' ), $post ); 1070 $t_time = sprintf( 1071 /* translators: 1: Post date, 2: Post time. */ 1072 __( '%1$s at %2$s' ), 1073 /* translators: Post date format. See https://www.php.net/date */ 1074 get_the_time( __( 'Y/m/d' ), $post ), 1075 /* translators: Post time format. See https://www.php.net/date */ 1076 get_the_time( __( 'g:i a' ), $post ) 1077 ); 1078 1072 1079 $time = get_post_timestamp( $post ); 1073 1080 $time_diff = time() - $time; 1074 1075 if ( $time && $time_diff > 0 && $time_diff < DAY_IN_SECONDS ) {1076 /* translators: %s: Human-readable time difference. */1077 $h_time = sprintf( __( '%s ago' ), human_time_diff( $time ) );1078 } else {1079 $h_time = get_the_time( __( 'Y/m/d' ), $post );1080 }1081 1081 } 1082 1082 … … 1109 1109 } 1110 1110 1111 if ( 'excerpt' === $mode ) { 1112 /** 1113 * Filters the published time of the post. 1114 * 1115 * If `$mode` equals 'excerpt', the published time and date are both displayed. 1116 * If `$mode` equals 'list' (default), the publish date is displayed, with the 1117 * time and date together available as an abbreviation definition. 1118 * 1119 * @since 2.5.1 1120 * 1121 * @param string $t_time The published time. 1122 * @param WP_Post $post Post object. 1123 * @param string $column_name The column name. 1124 * @param string $mode The list display mode ('excerpt' or 'list'). 1125 */ 1126 echo apply_filters( 'post_date_column_time', $t_time, $post, 'date', $mode ); 1127 } else { 1128 1129 /** This filter is documented in wp-admin/includes/class-wp-posts-list-table.php */ 1130 echo '<span title="' . $t_time . '">' . apply_filters( 'post_date_column_time', $h_time, $post, 'date', $mode ) . '</span>'; 1131 } 1111 /** 1112 * Filters the published time of the post. 1113 * 1114 * @since 2.5.1 1115 * @since 5.5.0 Removed the difference between 'excerpt' and 'list' modes. 1116 * The published time and date are both displayed now, 1117 * which is equivalent to the previous 'excerpt' mode. 1118 * 1119 * @param string $t_time The published time. 1120 * @param WP_Post $post Post object. 1121 * @param string $column_name The column name. 1122 * @param string $mode The list display mode ('excerpt' or 'list'). 1123 */ 1124 echo apply_filters( 'post_date_column_time', $t_time, $post, 'date', $mode ); 1132 1125 } 1133 1126
Note: See TracChangeset
for help on using the changeset viewer.