Title: Add media modal protection
Last modified: August 30, 2016

---

# Add media modal protection

 *  [Mark L](https://wordpress.org/support/users/marklimmagegmailcom/)
 * (@marklimmagegmailcom)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/add-media-modal-protection/)
 * Thanks again for the great plugin!
 * When adding new media by upload to a post / custom post via the add media button
   on the post editor page, there is no facility to add protection to the uploaded
   file in this modal. Is it possible for you to add this feature?
 * Thanks again – Mark
 * [https://wordpress.org/plugins/media-vault/](https://wordpress.org/plugins/media-vault/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [Mark L](https://wordpress.org/support/users/marklimmagegmailcom/)
 * (@marklimmagegmailcom)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/add-media-modal-protection/#post-6623901)
 * Adding the following code into the directory wp-content/mu-plugins/ activates
   a [must use plugin](https://codex.wordpress.org/Must_Use_Plugins) explained in
   a bit more detail [here ](http://premium.wpmudev.org/manuals/wpmu-manual-2/using-mu-plugins/).
 * This plugin changes the default upload url to
 * example.com/wp-content/uploads/sites/n/_mediavault/year/month/ for multisite 
   and
    example.com/wp-content/uploads/_mediavault/year/month/ for single site
 * This default behaviour applies to anything uploaded from anywhere which negates
   the need to add an enable protection option to the add media modal.
 *     ```
       <?php
   
       /*
       Plugin Name: Custom Upload Dirs
       Description: Changes the upload directory to what we would like, instead of what WordPress likes.
       Author: Mark
       Version: 1.0
       Author URI: http://maxicheapit.com.au/
       */
   
       add_filter('upload_dir', 'maxi_custom_upload_dir');
   
       /**
        * Changes the upload directory to what we would like,
        * instead of what WordPress likes.
        */
       function maxi_custom_upload_dir($upload) {
   
                $upload['path'] = $upload['basedir'] . '/_mediavault/'.current_time('Y'). '/' .current_time('m');
                $upload['url'] = $upload['baseurl'] . '/_mediavault/'.current_time('Y'). '/' .current_time('m');
   
           return $upload;
       }
   
       ?>
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Add media modal protection’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/media-vault_e6e2db.svg)
 * [Media Vault](https://wordpress.org/plugins/media-vault/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/media-vault/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/media-vault/)
 * [Active Topics](https://wordpress.org/support/plugin/media-vault/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/media-vault/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/media-vault/reviews/)

## Tags

 * [add media](https://wordpress.org/support/topic-tag/add-media/)
 * [protection](https://wordpress.org/support/topic-tag/protection/)

 * 1 reply
 * 1 participant
 * Last reply from: [Mark L](https://wordpress.org/support/users/marklimmagegmailcom/)
 * Last activity: [10 years, 6 months ago](https://wordpress.org/support/topic/add-media-modal-protection/#post-6623901)
 * Status: not resolved