Skip to content

Instantly share code, notes, and snippets.

@kellenmace
Last active April 21, 2017 14:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kellenmace/4499fdb2d495713ef827d1e113e91b90 to your computer and use it in GitHub Desktop.
Save kellenmace/4499fdb2d495713ef827d1e113e91b90 to your computer and use it in GitHub Desktop.
Get WordPress Uploads Directory Path
<?php
/**
* 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