Custom Fields
Re-Envisioned
Support Meta Box Group Image Not Retained On Update

This topic contains 1 reply, has 2 voices, and was last updated by  Anh Tran 1 month, 3 weeks ago.

  • Creator
    Topic
  • #11041

    knms5525
    Participant

    I have a group with an image field. I fill in my group and everything uploads and saves fine. If I go back and update content (not the image) and “Update” the image is not retained. I have to select and upload my group image(s) on every update. Is this a bug or am I missing something? Below is my group code.

    $meta_boxes[] = array(
            'title'  => 'Hero Images',
            'post_types'       => 'page',
            'fields' => array(
                array(
                    'id'     => $prefix.'heros',
                    // Group field
                    'type'   => 'group',
                    // Clone whole group?
                    'clone'  => true,
                    // Drag and drop clones to reorder them?
                    'sort_clone' => true,
                    // Sub-fields
                    'fields' => array(
                        array(
                            'name' => 'Title',
                            'id'   => $prefix.'herotitle',
                            'type' => 'text',
                        ),
                        array(
                            'name' => 'Sub Title',
                            'id'   => $prefix.'herosubtitle',
                            'type' => 'date',
                        ),
                        array(
        'name'             => 'Image',
        'id'               => $prefix.'heroimage',
        'type'             => 'image',
    
        // Delete image from Media Library when remove it from post meta?
        // Note: it might affect other posts if you use same image for multiple posts
        'force_delete'     => false,
    
        // Maximum image uploads
        // 'max_file_uploads' => 2,
    ),
                    ),
                ),
            ),
        );
Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #11062

    Anh Tran
    Keymaster

    Hello,

    Do you see images displayed when you update the post? Sometimes it takes some seconds to fully load the images.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.