title: ACF - Gallery Field -> reverse lookup to find all posts where that image is in the Gallery Field
body: <p>I am trying to do a reverse query to show me all of the posts that an image may be attached to using the ID of that image.</p>
  <p>The kicker is, the connection would be done using the ACF Gallery Field
  <a href="https://www.advancedcustomfields.com/resources/gallery/" rel="nofollow noreferrer">https://www.advancedcustomfields.com/resources/gallery/</a></p>
  <p>I have the ID's of the images noticed there was a meta data field for [&quot;uploaded_to&quot;] that I thought originally would work, but this is just a single ID, not an array, and is also only the post that the image was uploaded to and won't show if the image was uploaded directly to the media library.</p>
  <p>The only thing I can think of which would be very resource heavy and slow would be to loop through all posts and each field of those posts for the Gallery Field and then match on the ID of the image, and when there is match, output the ID of the post to an array. This sounds just messy and bloated.</p>
  <p>Is there an easier way to do this type of query?</p>