Make WordPress Core


Ignore:
Timestamp:
09/25/2012 05:26:19 AM (13 years ago)
Author:
nacin
Message:

Introduce constants to allow for easier expression of time periods in seconds. Adds MINUTE_IN_SECONDS, HOUR_IN_SECONDS, DAY_IN_SECONDS, WEEK_IN_SECONDS, YEAR_IN_SECONDS. props nbachiyski, SergeyBiryukov. fixes #20987.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/dashboard.php

    r21944 r21996  
    917917    if ( false === $plugin_slugs = get_transient( 'plugin_slugs' ) ) {
    918918        $plugin_slugs = array_keys( get_plugins() );
    919         set_transient( 'plugin_slugs', $plugin_slugs, 86400 );
     919        set_transient( 'plugin_slugs', $plugin_slugs, DAY_IN_SECONDS );
    920920    }
    921921
     
    10251025        ob_start();
    10261026        call_user_func_array( $callback, $args );
    1027         set_transient( $cache_key, ob_get_flush(), 43200); // Default lifetime in cache of 12 hours (same as the feeds)
     1027        set_transient( $cache_key, ob_get_flush(), 12 * HOUR_IN_SECONDS ); // Default lifetime in cache of 12 hours (same as the feeds)
    10281028    }
    10291029
     
    12161216            return false;
    12171217
    1218         set_site_transient( 'browser_' . $key, $response, 604800 ); // cache for 1 week
     1218        set_site_transient( 'browser_' . $key, $response, WEEK_IN_SECONDS );
    12191219    }
    12201220
Note: See TracChangeset for help on using the changeset viewer.