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/class-wp-plugins-list-table.php

    r21914 r21996  
    7171        }
    7272
    73         set_transient( 'plugin_slugs', array_keys( $plugins['all'] ), 86400 );
     73        set_transient( 'plugin_slugs', array_keys( $plugins['all'] ), DAY_IN_SECONDS );
    7474
    7575        if ( ! $screen->is_network ) {
    7676            $recently_activated = get_option( 'recently_activated', array() );
    7777
    78             $one_week = 7*24*60*60;
    7978            foreach ( $recently_activated as $key => $time )
    80                 if ( $time + $one_week < time() )
     79                if ( $time + WEEK_IN_SECONDS < time() )
    8180                    unset( $recently_activated[$key] );
    8281            update_option( 'recently_activated', $recently_activated );
Note: See TracChangeset for help on using the changeset viewer.