WordPress.org

Support

Support » Plugins and Hacks » Hacks » How to make Attachement's post_parent to be array to support multiple parent?

How to make Attachement's post_parent to be array to support multiple parent?

  • Is there any ways to make Attachement’s post_parent to be array to support multiple parent through hooks?

    Thus, finally could get where the attachments were attached to which posts.

    Thanks for any helps. thanks!

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    @bcworkz

    No, that field only accepts integers. Even if possible, it would probably break WP by inserting an array there.

    It appears the attachment post type only records the parent of it’s first use, there is no way to discern any other uses from the attachment post data. To get an accurate count like you are looking for could involve querying the content of all posts for references, as well as post_meta for use as featured images.

    I’d be curious to hear any other ideas on how to get a list of posts using a particular media attachment, without building custom reference data.

Viewing 1 replies (of 1 total)
  • The topic ‘How to make Attachement's post_parent to be array to support multiple parent?’ is closed to new replies.
Skip to toolbar