From 02c9aeaef37a6cd213b829cc72eba668ec34f00b Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Tue, 20 Oct 2015 06:55:25 +0000 Subject: [PATCH] Filesystem: Introduce constants to allow for easier expression of file sizes and other data amounts. Adds: * `KB_IN_BYTES` (kilobytes) * `MB_IN_BYTES` (megabytes) * `GB_IN_BYTES` (gigabytes) * `TB_IN_BYTES` (terabytes) Props nbachiyski, sudar. See #22405. Built from https://develop.svn.wordpress.org/trunk@35286 git-svn-id: http://core.svn.wordpress.org/trunk@35252 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/default-constants.php | 11 +++++++++++ wp-includes/version.php | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/wp-includes/default-constants.php b/wp-includes/default-constants.php index 795b9190dd..252c98e40b 100644 --- a/wp-includes/default-constants.php +++ b/wp-includes/default-constants.php @@ -107,6 +107,17 @@ function wp_initial_constants() { define( 'MONTH_IN_SECONDS', 30 * DAY_IN_SECONDS ); define( 'YEAR_IN_SECONDS', 365 * DAY_IN_SECONDS ); /**#@-*/ + + /**#@+ + * Constants for expressing human-readable data sizes in their respective number of bytes. + * + * @since 4.4.0 + */ + define( 'KB_IN_BYTES', 1024 ); + define( 'MB_IN_BYTES', 1024 * KB_IN_BYTES ); + define( 'GB_IN_BYTES', 1024 * MB_IN_BYTES ); + define( 'TB_IN_BYTES', 1024 * GB_IN_BYTES ); + /**#@-*/ } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 8c498e3218..067ef54251 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-35285'; +$wp_version = '4.4-alpha-35286'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.