• fab33390

    (@fab33390)


    Hi Guys!
    I need a snippet or plugin for limit the media upload space per user role.

    a) In my site there are some user roles and i need to set the maximum storage quota for each of these roles. I give an example: if an user has 149Mb of used space and the limit for his role is 150, when he select a file to be uploaded, must appear a blocking message and the upload can’t start.

    b) If the user role hanges (example: the role for 150Mb expires and go in the lower role with only 10Mb) the plugin must delete all media after 5 days (and send a mail to the user for reminding).
    If after 5 days the space is not anymore above the limit, because the user has deleted some media, the automatic bulk deletion must be canceled.

    Can you help me to this?

    thank’s in advance!!

    • This topic was modified 5 years ago by fab33390.
    • This topic was modified 5 years ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Everything else WordPress topic
Viewing 1 replies (of 1 total)
  • Ashwin Parthasarathi

    (@ashwinparthasarathi)

    hey @fab33390,

    I believe that you will need to write custom code to achieve this.

    The filter hook “wp_handle_upload_prefilter” should help you do the required validation before the actual file upload happens by checking the user role and the previously uploaded media.

    And you could run your file deletion logic on the action hook “set_user_role”.

    If you aren’t well versed with WordPress coding I recommend you to learn using the WordPress Developers Codex (https://codex.www.remarpro.com) or alternatively contact a developer to help you achieve your requirements.

Viewing 1 replies (of 1 total)
  • The topic ‘Media Storage limit for user role’ is closed to new replies.