[ Close ] Introducing Carbon Fields Version 3 - now with Gutenberg Blocks Support


Documentation > Fields > Image


Renders an image upload button with a preview thumbnail of the uploaded image. The built-in WordPress file handling interface is used.

Supported image formats are: jpg, jpeg, gif, png and bmp.

This field type stores the ID of the selected image.

Setup methods

set_type($mime_type) (defaults to image)

Set the allowed files type. Short mime types are also supported (audio, video, image).


Set the type of the stored value. (defaults to id)

You can also set the type to url to store the URL of the image instead of it’s ID.

Field::make("image", "crb_employee_photo", "Photo")

Excited about Carbon Fields? Spread the word!