Last active
August 29, 2015 14:15
-
-
Save mauriciogofas/dcb431bedb277340dd18 to your computer and use it in GitHub Desktop.
Muda a pasta de uploads padrão do WordPress && Change the default upload folder via the WordPress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Muda a pasta de uploads padrão do WordPress via functions.php | |
* mesmo com "define( 'UPLOADS', 'wp-content/'.'uploads' );" em wp-config.php | |
* Ideal para wp multisite. | |
* Change the default upload folder via the WordPress functions.php | |
* Even with "define( 'UPLOADS', 'wp-content/'.'uploads' );" in wp-config.php | |
* Ideal for wp multisite | |
* @upload_dir | |
* @wp_upload_dir | |
*/ | |
// Start | |
add_filter('upload_dir', 'gofas_upload_dir'); | |
function gofas_upload_dir($upload) { | |
$upload['basedir'] = '/var/www/mysite.com/htdocs/uploads'; | |
$upload['baseurl'] = 'http://mysite.com/uploads'; | |
$upload['path'] = $upload['basedir'] . $upload['subdir']; | |
$upload['url'] = $upload['baseurl'] . $upload['subdir']; | |
return $upload; | |
} | |
// End |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment