Changeset 21996 for trunk/wp-includes/functions.php
- Timestamp:
- 09/25/2012 05:26:19 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r21922 r21996 60 60 switch ( $type ) { 61 61 case 'mysql': 62 return ( $gmt ) ? gmdate( 'Y-m-d H:i:s' ) : gmdate( 'Y-m-d H:i:s', ( time() + ( get_option( 'gmt_offset' ) * 3600) ) );62 return ( $gmt ) ? gmdate( 'Y-m-d H:i:s' ) : gmdate( 'Y-m-d H:i:s', ( time() + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) ) ); 63 63 break; 64 64 case 'timestamp': 65 return ( $gmt ) ? time() : time() + ( get_option( 'gmt_offset' ) * 3600);65 return ( $gmt ) ? time() : time() + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ); 66 66 break; 67 67 } … … 215 215 $weekday += 7; 216 216 217 $start = $day - 86400* ( $weekday - $start_of_week ); // The most recent week start day on or before $day218 $end = $start + 604799; // $start + 7 days - 1 second217 $start = $day - DAY_IN_SECONDS * ( $weekday - $start_of_week ); // The most recent week start day on or before $day 218 $end = $start + 7 * DAY_IN_SECONDS - 1; // $start + 7 days - 1 second 219 219 return compact( 'start', 'end' ); 220 220 } … … 935 935 */ 936 936 function cache_javascript_headers() { 937 $expiresOffset = 864000; // 10 days937 $expiresOffset = 10 * DAY_IN_SECONDS; 938 938 header( "Content-Type: text/javascript; charset=" . get_bloginfo( 'charset' ) ); 939 939 header( "Vary: Accept-Encoding" ); // Handle proxies … … 3118 3118 return false; 3119 3119 } 3120 return round( timezone_offset_get( $timezone_object, $datetime_object ) / 3600, 2 );3120 return round( timezone_offset_get( $timezone_object, $datetime_object ) / HOUR_IN_SECONDS, 2 ); 3121 3121 } 3122 3122 … … 3318 3318 global $wpdb; 3319 3319 3320 $delete_timestamp = time() - ( 60*60*24*EMPTY_TRASH_DAYS);3320 $delete_timestamp = time() - ( DAY_IN_SECONDS * EMPTY_TRASH_DAYS ); 3321 3321 3322 3322 $posts_to_delete = $wpdb->get_results($wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_wp_trash_meta_time' AND meta_value < '%d'", $delete_timestamp), ARRAY_A);
Note: See TracChangeset
for help on using the changeset viewer.