When I execute this code in functions.php
I get the path:
$upload_dir = wp_upload_dir();
echo $upload_dir['path'];
//Returns: /some/correct/path/
But I want this path to be moved to my custom script located in uploads.php
where I can't execute wp_upload_dir();
. I obviously can't include()
functions.php either because it would execute everything else that is located there.
Is there any tricky way to pass $upload_dir
variable to uploads.php
?