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 might want to look into WP functions and possibly add a field to attachments that tell who uploaded the file. If you want to allow others besides the person that uploaded it then maybe create some type of additional settings for attachments that let you choose who can download it.

    There isn’t any way to get a list of images uses in any field that’s an image field. There’s nothing in the DB that indicates that a field is for an image other than the field definition in ACF. I think that looking for images attached to the user’s posts will be just as convoluted, if not more so, than getting the users posts and looking through them to find images and comparing them to the image they are trying to download.

    You could also alter the path where the images are stored, places each users files in a separate folder, perhaps. I have done this in this file for one of my plugins https://github.com/Hube2/blunt-gated-content/blob/master/admin/acf-upload-path.php