WordPress.org

Make WordPress Core

Ticket #22405: data-constants.diff

File data-constants.diff, 1.2 KB (added by nbachiyski, 6 years ago)
  • wp-includes/default-constants.php

     
    7373        if ( !defined('SHORTINIT') )
    7474                define('SHORTINIT', false);
    7575
    76         // Constants for expressing human-interval intervals
     76        // Constants for expressing human-readable intervals
    7777        // in their respective number of seconds.
    7878        define( 'MINUTE_IN_SECONDS', 60 );
    7979        define( 'HOUR_IN_SECONDS',   60 * MINUTE_IN_SECONDS );
    8080        define( 'DAY_IN_SECONDS',    24 * HOUR_IN_SECONDS   );
    8181        define( 'WEEK_IN_SECONDS',    7 * DAY_IN_SECONDS    );
    8282        define( 'YEAR_IN_SECONDS',  365 * DAY_IN_SECONDS    );
     83
     84        // Constants for expressing human-readable data sizes
     85        // in their respective number of bytes.
     86        define( 'KB_IN_BYTES', 1024 );
     87        define( 'MB_IN_BYTES', 1024 * KB_IN_BYTES );
     88        define( 'GB_IN_BYTES', 1024 * MB_IN_BYTES );
     89        define( 'TB_IN_BYTES', 1024 * GB_IN_BYTES );
     90        define( 'PB_IN_BYTES', 1024 * TB_IN_BYTES );
     91        define( 'EB_IN_BYTES', 1024 * PB_IN_BYTES );
     92        define( 'ZB_IN_BYTES', 1024 * EB_IN_BYTES );
     93        define( 'YB_IN_BYTES', 1024 * ZB_IN_BYTES );
    8394}
    8495
    8596/**