#[Image]

Attribute on parameters and properties.

use Saij\WpAppFramework\Value\Image;

An image from the media library, stored as its attachment ID. Allowed on ?int; the attribute gets role: content. In the editor the template marks the image with field(), and the canvas offers to select or replace it.

Arguments

#[Image(bool $inspector = false)]
ParameterTypeDefaultDescription
inspectorboolfalseEdit the field in the block inspector instead of the canvas; the template then prints it without field(), and changing it re-renders the block.