This is because subscribers do not have permission to upload files. You will need to either assign them to a role that can upload files or you’ll need to alter the subscriber permissions to allow them to upload. This https://wordpress.org/plugins/user-role-editor/ or similar plugins will let you do that.
But, a word of warning. Allowing subscribers the ability to upload files can be considered a security vulnerability. I would not do this on a site where anyone can join the site. You might want to think about an alternative. For example, you could create a repeater field with image sub fields. Then you can use the repeater in place of the gallery. If you want to keep the gallery you could build either an acf/pre_save_post or acf/save_post filter to copy the images from the repeater into the gallery.
Even if you use a gallery field the images will stay in the media library when removed from the gallery. To avoid this in either case you would need to create a filter that removed files no longer present in the fields and you’d need to compare the old values of the field with the new values to figure out what media needs to be deleted. For a front end form this could be done in an acf/pre_save_post filter.
Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users