Home › Forums › Front-end Issues › Front-end form image upload issues › Reply To: Front-end form image upload issues
I ran into the same problem. No upload for me in the frontend. As tgnsd mentioned earlier when the backend is disabled the ajax thing won’t work. I changed my code to this and the upload worked!
add_action( 'init', 'blockusers_init' );
function blockusers_init() {
if ( is_admin() && ! current_user_can( 'administrator' ) &&
! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
wp_redirect( home_url() );
exit;
}
}
I get this from here: https://premium.wpmudev.org/blog/limit-access-to-your-wordpress-dashboard/
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.