Last active
April 21, 2017 14:47
-
-
Save kellenmace/4499fdb2d495713ef827d1e113e91b90 to your computer and use it in GitHub Desktop.
Get WordPress Uploads Directory Path
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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