You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 20f5e9d
Browse filesBrowse the repository at this point in the historyBrowse files
-**Decorative images**: pass `'alt' => ''` to output `alt=""`, so assistive technologies skip the image. Omitting `alt` is not equivalent.
208
-
-**Static theme images** (logos, placeholders, illustrations from `dist/`): use `get_theme_static_image_markup()` / `the_theme_static_image()`. `width` and `height` come from `dist/assets.json` (`imageDimensions`, written at build time) to avoid layout shifts (CLS) without per-request filesystem reads. Files outside the build manifest fall back to a one-time read per path per request.
207
+
-**Decorative images (`alt=""`)** — same goal, two helpers depending on the source:
208
+
-**Media library** (`the_image` / `get_the_image`): pass `'alt' => ''` explicitly when the image is decorative. WordPress otherwise outputs the attachment alt from the admin. Omitting the `alt` key is not equivalent to `alt=""`.
209
+
-**Built theme files** under `dist/` (`the_theme_static_image` / `get_theme_static_image_markup`): decorative by default (`alt=""` if you do not pass `alt`). Pass a text alt when the image conveys meaning (e.g. logo with site name). Do not use `the_image` for these files (no attachment ID).
210
+
-**Static theme images** (placeholders, illustrations from `dist/`): the static helper also sets `width` and `height` from `dist/assets.json` (`imageDimensions`, written at build time) to limit CLS, without per-request filesystem reads when the manifest is present. Paths outside the build fall back to a one-time read per path per request.
-**Images décoratives** : passez `'alt' => ''` pour produire `alt=""`, afin que les technologies d’assistance ignorent l’image. Omettre `alt` n’est pas équivalent.
244
-
-**Images statiques du thème** (logos, placeholders, illustrations depuis `dist/`) : utilisez `get_theme_static_image_markup()` / `the_theme_static_image()`. `width` et `height` sont lus depuis le fichier (SVG ou raster) pour limiter les décalages de mise en page (CLS).
252
+
-**Images décoratives (`alt=""`)** — même objectif, deux helpers selon la source :
253
+
-**Médiathèque** (`the_image` / `get_the_image`) : passez `'alt' => ''` explicitement si l’image est décorative. Sinon WordPress reprend l’alt saisi dans le BO. Omettre la clé `alt` n’est pas équivalent à `alt=""`.
254
+
-**Fichiers buildés** dans `dist/` (`the_theme_static_image` / `get_theme_static_image_markup`) : décoratif par défaut (`alt=""` si vous ne passez pas `alt`). Indiquez un texte d’alt si l’image porte du sens (ex. logo + nom du site). Ne pas utiliser `the_image` pour ces fichiers (pas d’ID attachment).
255
+
-**Images statiques du thème** (placeholders, illustrations dans `dist/`) : le helper statique ajoute aussi `width` et `height` via `dist/assets.json` (`imageDimensions`, généré au build) pour limiter le CLS, sans lecture disque répétée lorsque le manifeste est présent. Hors manifeste : une lecture par chemin et par requête.
0 commit comments