Changeset 11323 for trunk/wp-includes/general-template.php
- Timestamp:
- 05/14/2009 02:00:32 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/general-template.php
r11312 r11323 1178 1178 function the_date_xml() { 1179 1179 global $post; 1180 echo mysql2date('Y-m-d', $post->post_date );1180 echo mysql2date('Y-m-d', $post->post_date, false); 1181 1181 } 1182 1182 … … 1237 1237 function get_the_modified_date($d = '') { 1238 1238 if ( '' == $d ) 1239 $the_time = get_post_modified_time(get_option('date_format') );1239 $the_time = get_post_modified_time(get_option('date_format'), null, null, true); 1240 1240 else 1241 $the_time = get_post_modified_time($d );1241 $the_time = get_post_modified_time($d, null, null, true); 1242 1242 return apply_filters('get_the_modified_date', $the_time, $d); 1243 1243 } … … 1267 1267 1268 1268 if ( '' == $d ) 1269 $the_time = get_post_time(get_option('time_format'), false, $post );1269 $the_time = get_post_time(get_option('time_format'), false, $post, true); 1270 1270 else 1271 $the_time = get_post_time($d, false, $post );1271 $the_time = get_post_time($d, false, $post, true); 1272 1272 return apply_filters('get_the_time', $the_time, $d, $post); 1273 1273 } … … 1281 1281 * @param bool $gmt Whether of not to return the gmt time. 1282 1282 * @param int|object $post Optional post ID or object. Default is global $post object. 1283 * @param bool $translate Whether to translate the time string or not 1283 1284 * @return string 1284 1285 */ 1285 function get_post_time( $d = 'U', $gmt = false, $post = null ) { // returns timestamp1286 function get_post_time( $d = 'U', $gmt = false, $post = null, $translate = false ) { // returns timestamp 1286 1287 $post = get_post($post); 1287 1288 … … 1291 1292 $time = $post->post_date; 1292 1293 1293 $time = mysql2date($d, $time );1294 $time = mysql2date($d, $time, $translate); 1294 1295 return apply_filters('get_post_time', $time, $d, $gmt); 1295 1296 } … … 1316 1317 function get_the_modified_time($d = '') { 1317 1318 if ( '' == $d ) 1318 $the_time = get_post_modified_time(get_option('time_format') );1319 $the_time = get_post_modified_time(get_option('time_format'), null, null, true); 1319 1320 else 1320 $the_time = get_post_modified_time($d );1321 $the_time = get_post_modified_time($d, null, null, true); 1321 1322 return apply_filters('get_the_modified_time', $the_time, $d); 1322 1323 } … … 1329 1330 * @param string $d Either 'G', 'U', or php date format. 1330 1331 * @param bool $gmt Whether of not to return the gmt time. 1332 * @param int|object $post A post_id or post object 1333 * @param bool translate Whether to translate the result or not 1331 1334 * @return string Returns timestamp 1332 1335 */ 1333 function get_post_modified_time( $d = 'U', $gmt = false ) {1334 global $post;1336 function get_post_modified_time( $d = 'U', $gmt = false, $post = null, $translate = false ) { 1337 $post = get_post($post); 1335 1338 1336 1339 if ( $gmt ) … … 1338 1341 else 1339 1342 $time = $post->post_modified; 1340 $time = mysql2date($d, $time );1343 $time = mysql2date($d, $time, $translate); 1341 1344 1342 1345 return apply_filters('get_the_modified_time', $time, $d, $gmt); … … 1352 1355 function the_weekday() { 1353 1356 global $wp_locale, $post; 1354 $the_weekday = $wp_locale->get_weekday(mysql2date('w', $post->post_date ));1357 $the_weekday = $wp_locale->get_weekday(mysql2date('w', $post->post_date, false)); 1355 1358 $the_weekday = apply_filters('the_weekday', $the_weekday); 1356 1359 echo $the_weekday; … … 1373 1376 if ( $day != $previousweekday ) { 1374 1377 $the_weekday_date .= $before; 1375 $the_weekday_date .= $wp_locale->get_weekday(mysql2date('w', $post->post_date ));1378 $the_weekday_date .= $wp_locale->get_weekday(mysql2date('w', $post->post_date, false)); 1376 1379 $the_weekday_date .= $after; 1377 1380 $previousweekday = $day;
Note: See TracChangeset
for help on using the changeset viewer.