0

Happy New year!

So I am having a big of a problem, currently one of our php files that we bought points to the default uploads directory for wordpress and we would like to change this to our own uploads directory.

We are still using the default uploads directory for wordpress but we want to change the directory where this custom php file uploads to.

Currently the code looks like this:

$upload_dir = wp_upload_dir();
$upload_dir['basedir'].'/downloads/encrypted/'.$item.'/*'));

It currently looks like this "www.example.com/wp-content/uploads/downloads/encrypted/"

We want it to point to "www.example.com/downloads/encrypted/"

Have looked into the arrays for wp_upload_dir(); but cannot seem to go a folder back. Any tips or help?

Thanks

  • Hook into said custom file or as last resort just edit it? – Rarst Dec 31 '13 at 0:57
  • Hi Rarst, I would like to edit the file but edit it to what? I tired to edit it to $url = site_url (); and nothing happened. – Lilap Jan 1 '14 at 1:54
1

try this way:

function wp128084_upload_dir( $pathdata ) {
     // change path here
     return $pathdata;
}

add_filter('upload_dir', 'wp128084_upload_dir');

add this where you want to change upload directory then again remove filter to change to default wordpress directory

remove_filter('upload_dir', 'wp128084_upload_dir');
0

You need to define UPLOADS constant.

Add the following line in your wp-config.php file

define( 'UPLOADS', ''.'downloads/encrypted' );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.