Home › Forums › Feature Requests › Uploaded Files Location › Reply To: Uploaded Files Location
Is this method still working in the latest ACF version?
I was working on a site locally until my database crashed last week. I used a customised version of your code for the last few weeks, but since I restored the site from a backup a few days ago I keep getting a 500 error when this function runs.
Here’s my code:
function my_upload_directory( $param ) {
$mydir = '/music';
$param['path'] = $param['basedir'] . $mydir;
$param['url'] = $param['baseurl'] . $mydir;
return $param;
}
function my_acf_upload_prefilter( $errors, $file, $field ) {
// change the upload directory
add_filter('upload_dir', 'my_upload_directory');
return $errors;
}
add_filter('acf/upload_prefilter/name=music-cover-art', 'my_acf_upload_prefilter');
Any idea where the problem might lie? I’m using the exact same code that worked before, the only thing that has changed seems to be the ACF version (5.5.3 to 5.5.5)?
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.