Ticket #20987: 20987.patch
File 20987.patch, 6.6 KB (added by , 12 years ago) |
---|
-
wp-admin/includes/class-wp-plugins-list-table.php
74 74 if ( ! $screen->is_network ) { 75 75 $recently_activated = get_option( 'recently_activated', array() ); 76 76 77 $one_week = 7*24*60*60;78 77 foreach ( $recently_activated as $key => $time ) 79 if ( $time + $one_week< time() )78 if ( $time + WEEK_IN_SECONDS < time() ) 80 79 unset( $recently_activated[$key] ); 81 80 update_option( 'recently_activated', $recently_activated ); 82 81 } -
wp-admin/includes/class-wp-posts-list-table.php
573 573 574 574 $time_diff = time() - $time; 575 575 576 if ( $time_diff > 0 && $time_diff < 24*60*60)576 if ( $time_diff > 0 && $time_diff < DAY_IN_SECONDS ) 577 577 $h_time = sprintf( __( '%s ago' ), human_time_diff( $time ) ); 578 578 else 579 579 $h_time = mysql2date( __( 'Y/m/d' ), $m_time ); -
wp-admin/includes/nav-menu.php
1150 1150 */ 1151 1151 function _wp_delete_orphaned_draft_menu_items() { 1152 1152 global $wpdb; 1153 $delete_timestamp = time() - ( 60*60*24*EMPTY_TRASH_DAYS);1153 $delete_timestamp = time() - ( DAY_IN_SECONDS * EMPTY_TRASH_DAYS ); 1154 1154 1155 1155 // delete orphaned draft menu items 1156 1156 $menu_items_to_delete = $wpdb->get_col($wpdb->prepare("SELECT ID FROM $wpdb->posts AS p LEFT JOIN $wpdb->postmeta AS m ON p.ID = m.post_id WHERE post_type = 'nav_menu_item' AND post_status = 'draft' AND meta_key = '_menu_item_orphaned' AND meta_value < '%d'", $delete_timestamp ) ); -
wp-admin/includes/plugin-install.php
74 74 if ( is_wp_error($tags) ) 75 75 return $tags; 76 76 77 set_site_transient( 'poptags_' . $key, $tags, 10800); // 3 * 60 * 60 = 1080077 set_site_transient( 'poptags_' . $key, $tags, 3 * HOUR_IN_SECONDS ); 78 78 79 79 return $tags; 80 80 } -
wp-includes/comment.php
1976 1976 if ( ! $days_old ) 1977 1977 return $posts; 1978 1978 1979 if ( time() - strtotime( $posts[0]->post_date_gmt ) > ( $days_old * 24 * 60 * 60) ) {1979 if ( time() - strtotime( $posts[0]->post_date_gmt ) > ( $days_old * DAY_IN_SECONDS ) ) { 1980 1980 $posts[0]->comment_status = 'closed'; 1981 1981 $posts[0]->ping_status = 'closed'; 1982 1982 } … … 2011 2011 if ( ! in_array( $post->post_type, $post_types ) ) 2012 2012 return $open; 2013 2013 2014 if ( time() - strtotime( $post->post_date_gmt ) > ( $days_old * 24 * 60 * 60) )2014 if ( time() - strtotime( $post->post_date_gmt ) > ( $days_old * DAY_IN_SECONDS ) ) 2015 2015 return false; 2016 2016 2017 2017 return $open; -
wp-includes/cron.php
206 206 */ 207 207 $lock = get_transient('doing_cron'); 208 208 209 if ( $lock > $local_time + 10 *60)209 if ( $lock > $local_time + 10 * MINUTE_IN_SECONDS ) 210 210 $lock = 0; 211 211 212 212 // don't run if another process is currently running it or more than once every 60 sec. … … 313 313 */ 314 314 function wp_get_schedules() { 315 315 $schedules = array( 316 'hourly' => array( 'interval' => 3600, 'display' => __('Once Hourly') ),317 'twicedaily' => array( 'interval' => 43200, 'display' => __('Twice Daily') ),318 'daily' => array( 'interval' => 86400, 'display' => __('Once Daily') ),316 'hourly' => array( 'interval' => HOUR_IN_SECONDS, 'display' => __('Once Hourly') ), 317 'twicedaily' => array( 'interval' => DAY_IN_SECONDS / 2, 'display' => __('Twice Daily') ), 318 'daily' => array( 'interval' => DAY_IN_SECONDS, 'display' => __('Once Daily') ), 319 319 ); 320 320 return array_merge( apply_filters( 'cron_schedules', array() ), $schedules ); 321 321 } -
wp-includes/default-constants.php
299 299 define( 'WP_DEFAULT_THEME', 'twentyeleven' ); 300 300 301 301 } 302 303 /** 304 * Defines time related WordPress constants 305 * 306 * @since 3.5.0 307 */ 308 function wp_time_constants( ) { 309 /** 310 * Constants for expressing human-interval intervals in their 311 * respective number of seconds 312 */ 313 define( 'MINUTE_IN_SECONDS', 60 ); 314 define( 'HOUR_IN_SECONDS', 60 * MINUTE_IN_SECONDS ); 315 define( 'DAY_IN_SECONDS', 24 * HOUR_IN_SECONDS ); 316 define( 'WEEK_IN_SECONDS', 7 * DAY_IN_SECONDS ); 317 define( 'MONTH_IN_SECONDS', 30 * DAY_IN_SECONDS ); 318 define( 'YEAR_IN_SECONDS', 365 * DAY_IN_SECONDS ); 319 320 /** 321 * Constants for expressing human-interval intervals in their 322 * respective number of minutes 323 */ 324 define( 'HOUR_IN_MINUTES', 60 ); 325 define( 'DAY_IN_MINUTES', 24 * HOUR_IN_MINUTES ); 326 define( 'WEEK_IN_MINUTES', 7 * DAY_IN_MINUTES ); 327 define( 'MONTH_IN_MINUTES', 30 * DAY_IN_MINUTES ); 328 define( 'YEAR_IN_MINUTES', 365 * DAY_IN_MINUTES ); 329 } -
wp-includes/functions.php
3220 3220 function wp_scheduled_delete() { 3221 3221 global $wpdb; 3222 3222 3223 $delete_timestamp = time() - ( 60*60*24*EMPTY_TRASH_DAYS);3223 $delete_timestamp = time() - ( DAY_IN_SECONDS * EMPTY_TRASH_DAYS ); 3224 3224 3225 3225 $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); 3226 3226 -
wp-settings.php
23 23 require( ABSPATH . WPINC . '/version.php' ); 24 24 25 25 // Set initial default constants including WP_MEMORY_LIMIT, WP_MAX_MEMORY_LIMIT, WP_DEBUG, WP_CONTENT_DIR and WP_CACHE. 26 wp_initial_constants( ); 26 wp_initial_constants(); 27 // Define time related constants. 28 wp_time_constants(); 27 29 28 30 // Check for the required PHP version and for the MySQL extension or a database drop-in. 29 31 wp_check_php_mysql_versions();