Skip to content

Image

An image from the media library, such as a logo.

In the editor

An image field in the editor, with .png and .svg as allowed extensions

Besides the settings every field shares, an image field has:

Setting What it does
Allowed extensions .jpeg .jpg, .png, .gif, .svg and .ico. Only images of the checked types can be chosen and uploaded.

WordPress does not allow SVG uploads by default: an SVG file can contain code. On such a site .svg can not be checked in the editor; the question mark next to it says why. A plugin such as Safe SVG allows SVG uploads and cleans the files; with it, the image field accepts SVG like any other image.

On the options page

The image field on the options page, with a logo, an Upload button and a Delete link

Upload opens the media library, to choose an image or upload a new one. Delete empties the field; the image stays in the media library.

The value

Stores the attachment ID of the image. An ID that is not an attachment becomes empty.

On your website

The shortcode shows the image, in the size you choose (default: full). Bound to an Image block, the block gets the image with its alt text.

[aop_option name="footer_logo" size="medium"]
echo wp_get_attachment_image( get_option( 'footer_logo' ), 'medium' );