Home › Forums › Backend Issues (wp-admin) › Check if file id is attached to post › Reply To: Check if file id is attached to post
You can get an array of all of the fields on a post by using get_fields()
https://www.advancedcustomfields.com/resources/get_fields/. I don’t know if this will be easier or not. Honestly, I don’t see anything I’d consider “easy” to accomplish what you’re doing.
I’d probably look in a different direction depending on how the files get attached to a post belonging to a user. For example maybe adding a field to attachments that records the user that uploaded it if the user is attaching them or if an admin is making the decision then a field where the admin sets who can download them. There are probably other solutions, still, none of them easy.
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.