Title: Question regarding custom plugin
Last modified: August 19, 2016

---

# Question regarding custom plugin

 *  Resolved [do77](https://wordpress.org/support/users/do77/)
 * (@do77)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/question-regarding-custom-plugin/)
 * Hi,
 * I have someone develop a custom plugin for a friend of mine. Its basically a 
   mini-gallery for each post where you can add images from the media library to
   the mini-gallery via custom fields.
 * Anyway, the point is that if I add an image to the mini-gallery, it always duplicates
   that image in the media library. So let’s say I have 10 images in the media library
   and I add four pictures to the mini-gallery, then I suddenly have 14 pictures
   in the media library.
 * This seems quite odd to me so I asked the developer why that is. He then said:
 *     ```
       Each media can have only one post.
       Thats why if adding one image to post, the images in media also increase.
       This is the way WordPress works.
       ```
   
 * Is that correct? I mean if I add an image to a post my media library has never
   been increasing so it sounds kind of weird to me.
 * Hope someone can help me with that!
 * Thanks a lot!
    do77

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/question-regarding-custom-plugin/#post-1956053)
 * > Is that correct?
 * Yes. This is how the native WordPress Gallery works.
 *  Thread Starter [do77](https://wordpress.org/support/users/do77/)
 * (@do77)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/question-regarding-custom-plugin/#post-1956069)
 * Mmhh … so I just created a post on another blog of mine. I opened the media library(
   396 images) and added one image to the post. After adding I opened the media 
   library again and I still have 396 images. Why hasn’t it increased by +1 then?
 * Understand me right esmi … I don’t want to say that I don’t believe you I just
   try to understand 🙂
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/question-regarding-custom-plugin/#post-1956085)
 * If you simply insert images that are already in the Media Library, it will not
   increase. However, if you want to use anything based upon the native WordPress
   Gallery in posts or pages, you have to upload the relevant whilst editing the
   appropriate pats/page. Want to use the same image in another gallery? You have
   to upload it again.
 *  Thread Starter [do77](https://wordpress.org/support/users/do77/)
 * (@do77)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/question-regarding-custom-plugin/#post-1956100)
 * But I only want to use images that are already in the media library. I choose
   an image from there, add it to the mini-gallery and that’s it. I mean the media
   library doesn’t increase when I add an image via a custom field.
 * What do you exactly mean by ‘based upon the **native** WP Gallery’?
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/question-regarding-custom-plugin/#post-1956102)
 * See [http://codex.wordpress.org/User:Esmi/The_WordPress_Gallery](http://codex.wordpress.org/User:Esmi/The_WordPress_Gallery)
 *  Thread Starter [do77](https://wordpress.org/support/users/do77/)
 * (@do77)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/question-regarding-custom-plugin/#post-1956110)
 * Okay, I see how that works now! Thanks esmi.
 * I am not so sure though if that is a great solution then. This will substantially
   increase the media library with each new post and thus use a lot of disk space.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Question regarding custom plugin’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 2 participants
 * Last reply from: [do77](https://wordpress.org/support/users/do77/)
 * Last activity: [15 years, 2 months ago](https://wordpress.org/support/topic/question-regarding-custom-plugin/#post-1956110)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
