WordPress.org

Support

Support » Plugins and Hacks » Hacks » How to automatically update Dashboard "Space Used".

How to automatically update Dashboard "Space Used".

  • Hi,

    I have created a plugin to my wordpress multisite users. This plugin has a feature that uploads an image to the correct upload path for each blog and is not using the standard wordpress uploader. However, when the image is uploaded, the “Space used” in the dashboard is not automatically updated unless you upload something on the standard wordpress uploader.

    My question is, how can i update the “Space Used” automatically once the image is uploaded from the plugin? Is there a function for this?

    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Once your upload is complete, you need to delete the transient which caches the dir size.

    delete_transient(  'dirsize_cache' );

    Is there a function to check whether the blog has reached the maximum space allowed? Like an if condition..

    For example

    if(upload_size_reached) {
    do not upload
    } else {
    upload it
    }

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to automatically update Dashboard "Space Used".’ is closed to new replies.
Skip to toolbar