Change upload location using 'upload_dir' filter
-
Hey all,
Does anybody know how to use the ‘upload_dir’ filter successfully?
I’m trying to change the location via a filter if the user is on a specific page but I am failing, so any help is much apprciated.
The filter is working as when I call
<?php echo '<pre>'; print_r(wp_upload_dir()); echo '</pre>'; ?>
I see the desired file paths, but it doesn’t seem to be getting called when I actually upload an image.function djg_upload_folder(){ $array = array( 'path' => WP_CONTENT_DIR.'/uploads/custom-admin-images', 'url' => WP_CONTENT_URL.'/uploads/custom-admin-images', 'subdir' => '', 'basedir' => WP_CONTENT_DIR.'/uploads', 'baseurl' => WP_CONTENT_URL.'/uploads', 'error' => false ); return $array; }
Thanks.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Change upload location using 'upload_dir' filter’ is closed to new replies.