Skip to content

Instantly share code, notes, and snippets.

@fitzhaile
Created December 28, 2013 17:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fitzhaile/8162164 to your computer and use it in GitHub Desktop.
Save fitzhaile/8162164 to your computer and use it in GitHub Desktop.
Fix media directory location to be outside of wordpress root.
<?php
/**
* Fix media directory location to be outside of wordpress root
*/
if ( empty( $upload_path ) || 'wp-content/uploads' == $upload_path ) {
update_option( 'upload_path', untrailingslashit( str_replace( 'wp', 'media', ABSPATH ) ) );
update_option( 'upload_url_path', home_url( 'media' ) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment