Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Get WordPress Uploads Directory Path
* Get the absolute path to the WordPress uploads directory,
* with a trailing slash.
* @return string The uploads directory path.
function km_get_wordpress_uploads_directory_path() {
$upload_dir = wp_upload_dir();
return trailingslashit( $upload_dir['basedir'] );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment