Changeset 21474 for trunk/wp-admin/includes/ms.php
- Timestamp:
- 08/08/2012 07:17:33 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/ms.php
r21414 r21474 303 303 * Determines if there is any upload space left in the current blog's quota. 304 304 * 305 * @since 3.0.0 306 * 305 307 * @return int of upload space available in bytes 306 308 */ … … 332 334 $space_allowed = get_space_allowed(); 333 335 if ( empty( $space_allowed ) || !is_numeric( $space_allowed ) ) 334 $space_allowed = 10; // Default space allowed is 10 MB336 $space_allowed = 10; // Default space allowed is 10 MB 335 337 336 338 $space_used = get_space_used(); 337 339 338 if ( ( $space_allowed - $space_used ) < 0 ) {340 if ( ( $space_allowed - $space_used ) < 0 ) { 339 341 if ( $echo ) 340 342 _e( 'Sorry, you have used your space allocation. Please delete some files to upload more files.' ); … … 345 347 } 346 348 349 /** 350 * Returns the space used by the current blog. 351 * 352 * @since 3.5.0 353 * 354 * @return int Used space in megabytes 355 */ 347 356 function get_space_used() { 348 357 // Allow for an alternative way of tracking storage space used 349 358 $space_used = apply_filters( 'pre_get_space_used', false ); 350 359 if ( false === $space_used ) 351 $space_used = get_dirsize( BLOGUPLOADDIR ) ;360 $space_used = get_dirsize( BLOGUPLOADDIR ) / 1024 / 1024; 352 361 353 362 return $space_used; … … 357 366 * Returns the upload quota for the current blog. 358 367 * 359 * @return int Quota 368 * @since MU 369 * 370 * @return int Quota in megabytes 360 371 */ 361 372 function get_space_allowed() { … … 371 382 } 372 383 384 /** 385 * Displays the amount of disk space used by the current blog. Not used in core. 386 * 387 * @since MU 388 */ 373 389 function display_space_usage() { 374 390 $space_allowed = get_space_allowed(); … … 407 423 408 424 $available = get_upload_space_available(); 409 return min( $size, $available );425 return min( $size, $available ); 410 426 } 411 427
Note: See TracChangeset
for help on using the changeset viewer.