Forums

How to automatically update Dashboard "Space Used". (3 posts)

  1. chibib0
    Member
    Posted 8 months ago #

    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.

  2. Jackson
    Member
    Posted 8 months ago #

    Once your upload is complete, you need to delete the transient which caches the dir size.

    delete_transient(  'dirsize_cache' );
  3. chibib0
    Member
    Posted 6 months ago #

    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!

Reply

You must log in to post.

About this Topic