src/Forms/Resources/Transformers/CollectionFieldTransformer.php
protected function getOptions(FieldTypeInterface $field)
    {
        $options = parent::getOptions($field);

        $options['items'] = array_map(function ($id) {
            return [
                'attributes' => wp_prepare_attachment_for_js($id),
                'id' => $id
            ];
        }, (array) $field->getValue());

        return $options;
    }
protected function getOptions(FieldTypeInterface $field)
    {
        $options = parent::getOptions($field);

        $options['items'] = array_map(function ($id) {
            return [
                'attributes' => wp_prepare_attachment_for_js($id),
                'id' => $id
            ];
        }, (array) $field->getValue());

        return $options;
    }
protected function getOptions ( FieldTypeInterface $ field ) { $ options = parent :: getOptions ( $ field ) ; $ options [ 'items' ] = array_map ( function ( $ id ) { return [ 'attributes' => wp_prepare_attachment_for_js ( $ id ) , 'id' => $ id ] ; } , ( array ) $ field -> getValue ( ) ) ; return $ options ; }
Transform field options.

@param FieldTypeInterface $field

@return array
Transform field options .