Support

Account

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.