Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




upload_is_user_over_quota [ WordPress Function ]

upload_is_user_over_quota ( $echo = true )
Parameters:
  • (bool) $echo Optional. If $echo is set and the quota is exceeded, a warning message is echoed. Default is true.
Uses:
Returns:
  • (int)
Defined at:



Check whether a blog has used its allotted upload space.

Source


<?php
function upload_is_user_over_quota$echo true ) {
    if ( 
get_site_option'upload_space_check_disabled' ) )
        return 
false;

    
$spaceAllowed get_space_allowed();
    if ( empty( 
$spaceAllowed ) || !is_numeric$spaceAllowed ) )
        
$spaceAllowed 10;    // Default space allowed is 10 MB

    
$size get_dirsizeBLOGUPLOADDIR ) / 1024 1024;

    if ( (
$spaceAllowed-$size) < ) {
        if ( 
$echo )
            
_e'Sorry, you have used your space allocation. Please delete some files to upload more files.' ); // No space left
        
return true;
    } else {
        return 
false;
    }
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics