diff --git a/src/wp-includes/default-constants.php b/src/wp-includes/default-constants.php index 79e16428ed13b..f1c0320a6fc27 100644 --- a/src/wp-includes/default-constants.php +++ b/src/wp-includes/default-constants.php @@ -58,6 +58,8 @@ function wp_initial_constants() { define( 'WP_MAX_MEMORY_LIMIT', $current_limit ); } elseif ( -1 === $current_limit_int || $current_limit_int > 268435456 /* = 256M */ ) { define( 'WP_MAX_MEMORY_LIMIT', $current_limit ); + } elseif ( wp_convert_hr_to_bytes( WP_MEMORY_LIMIT ) > 268435456 /* = 256M */ ) { + define( 'WP_MAX_MEMORY_LIMIT', WP_MEMORY_LIMIT ); } else { define( 'WP_MAX_MEMORY_LIMIT', '256M' ); }