wp_get_upload_dir() WordPress Function
The wp_get_upload_dir() function is used to retrieve the upload directory for a given site. This function returns an array of information, including the path to the upload directory and the URL to the upload directory.
wp_get_upload_dir() #
Retrieves uploads directory information.
Description
Same as wp_upload_dir() but "light weight" as it doesn’t attempt to create the uploads directory. Intended for use in themes, when only ‘basedir’ and ‘baseurl’ are needed, generally in all cases when not uploading files.
See also
Return
(array) See wp_upload_dir() for description.
Source
File: wp-includes/functions.php
function wp_get_upload_dir() { return wp_upload_dir( null, false ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
4.5.0 | Introduced. |