On this page
apply_filters( 'upload_dir', array $uploads )
Filters the uploads directory data.
Parameters
$uploadsarray-
Array of information about the upload directory.
pathstringBase directory and subdirectory or full path to upload directory.urlstringBase URL and subdirectory or absolute URL to upload directory.subdirstringSubdirectory if uploads use year/month folders option is on.basedirstringPath without subdir.baseurlstringURL path without subdir.errorstring|falseFalse or error message.
More Information
This hook allows you to change the directory where files are uploaded to. The keys and values in the array are used by the wp_upload_dir() function in wordpress core, which is doing the work
Source
File: wp-includes/functions.php. View all references
$uploads = apply_filters( 'upload_dir', $cache[ $key ] );
Related
Used By
| Used By | Description |
|---|---|
| wp_upload_dir() wp-includes/functions.php | Returns an array containing the current upload directory’s path and URL. |
Changelog
| Version | Description |
|---|---|
| 2.0.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/upload_dir