Support » Plugin: Multisite Media Display » Custom Post Type Specific Images

  • Resolved atomicnicholas

    (@atomicnicholas)


    Hi Rick,

    Very nice to see this plugin. Is if there is a way to filter and limit images to be those only attached to custom post types you set in the shortcode?

    If not, what would you suggest I could do to adjust your plugin to do this? (Essentially having the option and setting posting/display to the set custom post type only)

    Thanks for checking this out.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author rhellewell

    (@rhellewellgmailcom)

    Hello! Thanks for the nice comment.

    Having an option for post type would be useful. Since the code does a standard WPQuery, it would only require adding an element to the array (around line 480 in the code).

    But, the images already have a ‘post-tyoe’ of ‘attachment’. I don’t see (with a quick google) that images are ‘attached’ to a specific post ID. Images can be part of any post (or page), so don’t really have a ‘parent’ that the image belongs to. I base this on the answer here.

    So in order to do what you want, there would have to be a filter that would attach a post-ID to an image that was uploaded with a post. And then, what if the same picture needs to be attached to multiple posts? How would you determine which post-ID to attach the image to?

    That fact (that images don’t have a post ‘parent’), and that images are really another type of ‘post’, would make it very difficult to add that feature.

    Hope this helps. Thanks for the kind words about the plugin – I use it all the time to monitor images submitted on one of my multi-sites. (And reviews are always nice also.)

    Rick, That’s incredible. Thank you very much for your speedy and thorough reply (my apologies for not responding sooner, forgot to reenable notifications).

    That’s really concise and useful information– good thing I asked you first, too, as this saved me a lot of time and grief: I wasn’t aware (or forgot) that images were directly attached to a regular post per se. I did assume that so glad to get your correction. I will try and apply them for my purposes and see if another approach will work, then.

    I’ll also be dropping a 5 star review now– can’t believe I forgot to do that (thought I did) last time!

    Thanks again!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom Post Type Specific Images’ is closed to new replies.