Home › Forums › Front-end Issues › Frontend form – custom role can't upload picture › Reply To: Frontend form – custom role can't upload picture
Hi, Same problem here. Not sure how this worked. I am not using the plugin https://wordpress.org/plugins/theme-my-login/ so where and how the codes should go?
File upload works fine from backend when logged in as a user.
I changed the user permission to below:
add_action('wp', 'allow_employer_uploads');
function allow_employer_uploads() {
$employer = get_role('employer');
// author caps
$employer->add_cap('edit_published_posts');
$employer->add_cap('delete_posts');
$employer->add_cap('edit_posts');
$employer->add_cap('upload_files');
// editor caps
$employer->add_cap('edit_others_posts');
}
Thanks
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.