• 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/

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