Image
Corex\Assets\Image · class · Core layer
Renders a source-controlled image (theme/plugin/client asset, spec 062) — distinct from a WordPress Media Library upload (which is Corex\Media\*). tag() emits a plain optimized <img>; picture() delegates to {@see Picture} for a WebP <source> + <img> fallback when a built .webp sibling exists. The URL is resolved (manifest-hashed when present) through the {@see AssetManager}. echo Corex\Assets\Image::picture(‘images/hero.jpg’, [‘alt’ => ‘Hero’, ‘class’ => ‘hero__image’]);
Public API
Section titled “Public API”tag(string $relative, array $attrs): string
Section titled “tag(string $relative, array $attrs): string”picture(string $relative, array $attrs): string
Section titled “picture(string $relative, array $attrs): string”Optimized <picture> (WebP <source> + <img> fallback) when a built .webp sibling exists.
img(string $url, array $attrs): string
Section titled “img(string $url, array $attrs): string”Build one <img> from a resolved URL + attributes. Escaped; lazy + async by default.