mercredi 31 décembre 2014

using the filter 'upload_dir'


I want to override the /year/month scheme and upload my files to a specific folder. I've copied the following code form codex.wordpress and inserted in my theme functions.php:



add_filter('upload_dir', 'awesome_wallpaper_dir');

function awesome_wallpaper_dir( $param ){
$mydir = '/awesome';

$param['path'] = $param['path'] . $mydir;
$param['url'] = $param['url'] . $mydir;

return $param;
}


but when I upload a file it is stored in /year/month subdir. What's wrong?





Aucun commentaire:

Enregistrer un commentaire