John,
It is still picking up that field. IF you could help me we could do like a teamviewer or skype. My skype is dmyers7980. I have been trying for a week.
field type is “File” file object library is set to all
Even still it is uploading to /wp-content/uploads/2016/08/ not a sub folder
no I want them to be in website.com/profiles/
so the profiles will be on root site
@John Huebner
Ok so I tried your script and it is not loading for me. Everything I upload is still going to default and when going to select file still pulling default and not teh custom field.
My custom folder is /profiles/
My ACF Field is dn_cv_link
The function code is below.
add_filter(‘acf/upload_prefilter/name=dn_cv_link’, ‘field_name_upload_prefilter’);
function field_nameupload_prefilter($errors) {
// in this filter we add a WP filter that alters the upload path
add_filter(‘upload_dir’, ‘field_name_upload_dir’);
return $errors;
}
// second filter
function field_name_upload_dir($uploads) {
// here is where we later the path
$uploads[‘path’] = $uploads[‘basedir’].’/profiles/’;
$uploads[‘url’] = $uploads[‘baseurl’].’/profiles/’;
$uploads[‘subdir’] = ”;
return $uploads;
}
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.