Support

Account

Home Forums Front-end Issues Gallery field in a front-end form for non-logged-in users

Solved

Gallery field in a front-end form for non-logged-in users

  • When I click “add to gallery” button as non-logged-in user I’m getting:
    acf-input.min.js?ver=5.3.5:2 Uncaught TypeError: Cannot read property 'query' of undefined

    It happens because wp.media is undefined for non-logged-in users… and it happens because the Media Library is not accessible by non-logged-in users.

    Is it possible to upload media as non-logged-in users, but not giving them the media library access?

  • I’m pretty sure that the image and file field types will work for users that aren’t logged in. Those field have alternate upload methods. If you want them to be able to create a gallery you could use a repeater with rows of image fields. Using the acf/save post filter you could probably build an image gallery field from the values uploaded to the repeater.

  • This is some kind of a solution but not the one I have been looking for. But I’m aware that implementing gallery field for non-logged-in users would require a lot of effort (It would probably require to re-implement the WP uploader).

    Thanks.

  • You would need to give non logged in users access to the media library, which I think can be done, but is not something that would be recommended. The Gallery field will only work for users that have full access to the media library on the site.

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Gallery field in a front-end form for non-logged-in users’ is closed to new replies.