Created
May 13, 2012 02:00
-
-
Save imjjss/2670250 to your computer and use it in GitHub Desktop.
filter upload dir
This file contains 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 | |
add_filter('upload_dir', 'my_upload_dir'); | |
$upload = wp_upload_dir(); | |
remove_filter('upload_dir', 'my_upload_dir'); | |
funcion my_upload_dir($upload) { | |
$upload['subdir'] = '/sub-dir-to-use' . $upload['subdir']; | |
$upload['path'] = $upload['basedir'] . $upload['subdir']; | |
$upload['url'] = $upload['baseurl'] . $upload['subdir']; | |
return $upload; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment