Skip to content

Instantly share code, notes, and snippets.

@aaronjorbin
Created September 9, 2014 18:43
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 aaronjorbin/736afd42103b0e9eac74 to your computer and use it in GitHub Desktop.
Save aaronjorbin/736afd42103b0e9eac74 to your computer and use it in GitHub Desktop.
<?php
add_filter('upload_dir' , 'vogue_change_upload_dir');
function vogue_change_upload_dir( $dir ){
$time = current_time( 'mysql' );
$y = substr( $time, 0, 4 );
$m = substr( $time, 5, 2 );
$d = substr( $time, 8, 2 );
$subdir = "/vogue//$y/$m/$d";
$dir['subdir'] = $subdir;
$dir['dir'] = $dir['basedir'] . $subdir;
$dir['url'] = $dir['baseurl'] . $subdir;
return $dir;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment