upload_dir
Filters the uploads directory data.
Usage
add_filter( 'upload_dir', 'wp_kama_upload_dir_filter' ); /** * Function for `upload_dir` filter-hook. * * @param array $uploads Array of information about the upload directory. * * @return array */ function wp_kama_upload_dir_filter( $uploads ){ // filter... return $uploads; }
- $uploads(array)
Array of information about the upload directory.
-
path(string)
Base directory and subdirectory or full path to upload directory. -
url(string)
Base URL and subdirectory or absolute URL to upload directory. -
subdir(string)
Subdirectory if uploads use year/month folders option is on. -
basedir(string)
Path without subdir. -
baseurl(string)
URL path without subdir. - error(string|false)
False or error message.
-
Changelog
Since 2.0.0 | Introduced. |
Where the hook is called
upload_dir
wp-includes/functions.php 2380
$uploads = apply_filters( 'upload_dir', $cache[ $key ] );