Title: Problem when saving Post with Chil Post
Last modified: August 21, 2016

---

# Problem when saving Post with Chil Post

 *  [Colir](https://wordpress.org/support/users/colir/)
 * (@colir)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/problem-when-saving-post-with-chil-post/)
 * Hi,
    wp Simple galleries have a problem when saving a post which have childs 
   post.
 * I’ve setup custom post type with the Types plugin, and set up to have custom 
   child post.
    In this case, when saving parent post, all the child post are re-
   save.
 * I set up different Gallerie on child post, and a gallerie on the parent post.
   
   When i’m saving (update) the parent post, all the gallerie’s child get overwrite
   by the parent gallerie.
 * I think the problem is here
 *     ```
       public function save_post_meta($post_id) {
               if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
                   return '';
               }
               if (!isset($_POST['wpsimplegallery_gallery_nonce']) || !wp_verify_nonce($_POST['wpsimplegallery_gallery_nonce'], basename(__FILE__)))
                   return (isset($post_id)) ? $post_id : 0;
   
               $images = (isset($_POST['wpsimplegallery_thumb'])) ? $_POST['wpsimplegallery_thumb'] : array();
   
       		$gallery = array();
               if (count($images) > 0) {
                   foreach ($images as $i => $img) {
                       if (is_numeric($img))
                           $gallery[] = $img;
                   }
               }
               update_post_meta($post_id, 'wpsimplegallery_gallery', $gallery);
               return $post_id;
           }
       ```
   
 * It’s like it doesn’t retrieve the $images from child post.
 * thanks.
 * [http://wordpress.org/plugins/wp-simple-galleries/](http://wordpress.org/plugins/wp-simple-galleries/)

The topic ‘Problem when saving Post with Chil Post’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-simple-galleries_7f8da9.svg)
 * [WP Simple Galleries](https://wordpress.org/plugins/wp-simple-galleries/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-simple-galleries/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-simple-galleries/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-simple-galleries/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-simple-galleries/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-simple-galleries/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Colir](https://wordpress.org/support/users/colir/)
 * Last activity: [12 years, 9 months ago](https://wordpress.org/support/topic/problem-when-saving-post-with-chil-post/)
 * Status: not resolved