Get all posts (of any post type) an attachment is used in
Second pass. Known issues: Needs caching (and the cache needs to be tidied up where possible) Post types are hard-coded Which post statuses are we interested in? Here’s the function: /** * Given an attachment ID, searches for any post with that attachment used * as a featured image, or if it is present in … Read more