Last active
January 21, 2021 18:47
-
-
Save webhouse-dev/25c8ac147518f879c48dce63516db03b to your computer and use it in GitHub Desktop.
Upload WordPress images to day folders
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
/** | |
* @snippet Upload WordPress images to day folders | |
* @how-to Add to functions.php or get plugin Code Snippets | |
* @author webhouse.dev | |
* @url https://webhouse.dev | |
*/ | |
function upload_dir_filter($uploads){ | |
$day = date('d'); | |
$uploads['path'] .= '/' . $day; | |
$uploads['url'] .= '/' . $day; | |
return $uploads; | |
} | |
add_filter('upload_dir', 'upload_dir_filter'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment