Make WordPress Core

Ticket #28238: getspaceusedfilter.diff

File getspaceusedfilter.diff, 895 bytes (added by hereswhatidid, 10 years ago)

Update get_space_used() to filter the returned $space_used value

  • wp-includes/ms-functions.php

     
    22922292                $upload_dir = wp_upload_dir();
    22932293                $space_used = get_dirsize( $upload_dir['basedir'] ) / 1024 / 1024;
    22942294        }
    2295 
    2296         return $space_used;
     2295        /**
     2296         * Filter the amount of storage space used by the current site after default calculations have been applied.
     2297         *
     2298         * @since 3.9.1
     2299         *
     2300         * @param int $space_used The amount of used space, in megabytes.
     2301         */
     2302        return apply_filters( 'get_space_used', $space_used );
    22972303}
    22982304
    22992305/**
  • .