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.

Top ↑

See also


Top ↑

Return

(array) See wp_upload_dir() for description.


Top ↑

Source

File: wp-includes/functions.php

function wp_get_upload_dir() {
	return wp_upload_dir( null, false );
}


Top ↑

Changelog

Changelog
VersionDescription
4.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More