Image Advanced Required Validation Not Working

Support General Image Advanced Required Validation Not WorkingResolved

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #20475
    ossama saeedossama saeed
    Participant

    Hello guys,

    The required validation for the advanced image is not working

    
    add_filter( 'rwmb_meta_boxes', 'prefix_register_meta_boxes' );
    function prefix_register_meta_boxes( $meta_boxes ) {
        $meta_boxes[] = array(
            'title'      => 'Logos',
            'post_types' => 'news',
            'fields' => array(
                array(
                    'name' => 'Add Logos ?',
                    'id'   => 'news_logos',
                    'type' => 'checkbox',
                    'std'  => 0, // 0 or 1
                ),
                array(
                    'name'  => 'Title',
                    'id'    => 'news_logos_title',
                    'type'  => 'text',
                    'visible' => array( 'news_logos', true ),
                    'required' => 1,
                ),
                array(
                    'name'  => 'Logo',
                    'id'    => 'news_logos_img',
                    'type'  => 'image_advanced',
                    'max_file_uploads' => 1,
                    'visible' => array( 'news_logos', true ),
                    'clone' => true,
                    'sort_clone' => true,
                    'required' => 1, // This is not working 
                ),
            ),
            'validation' => array(
                'rules'  => array(
                    'news_logos_img' => array(
                        'required'  => true, // This is not working 
                    ),
                ),
                'messages' => array(
                    'news_logos_img' => array(
                        'required'  => 'This field is required',
                    ),
                )
            )
        );
    
        return $meta_boxes;
    }
    

    Thanks in advanced

    #20483
    Long NguyenLong Nguyen
    Moderator

    Hi,

    I'm going to check it out and let you know later.

    Thank you.

    #20559
    ossama saeedossama saeed
    Participant

    Hi Long,

    Any updates regard this problem ?

    #20627
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Please update the new version of the plugin Meta Box v5.3.2 to fix this issue.

    #20645
    ossama saeedossama saeed
    Participant

    It is working now.

    Thank you,

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.