Repository navigation
Conversation
🤖 PR meta 🤖📦 Bundle sizeSize Change: +5.78 kB (+0.07%) Total Size: 8.52 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
|
|
+1 to good fallback icon. As @ciampo mentioned, the I also don't like using the |
|
It doesn't have to be an icon — in fact, Base UI (and our @wordpress/ui version) both use initials as fallback. So maybe we can use initials and, if for any reason that can't be done, fall back to the diagonal line? Also, @jameskoster , while we're here, do you think that
|



See #84537, Batch 1.
What?
Use the WordPress UI Avatar in the post, template, template-part, and media author fields.
Why?
These fields duplicate image-loading state and avatar styles. The shared Avatar handles loaded, missing, and failed author images with initials as the fallback.
How?
Render the 16px Avatar whenever an author image URL or initials are available. Show the image when it loads; otherwise show up to two initials; otherwise show the original author icon without an Avatar frame. Avatar owns image loading and failure states. Theme authors retain their original icon and spacing. Preserve author lookup, visible names, and site/plugin fallbacks. Avatars remain decorative beside the author field.
Testing Instructions
avatar_urls[48]and clearnameor replace it with whitespace. For template users, also clearauthor_text. Confirm the image still displays. Make the image request fail and confirm the original icon appears without an Avatar frame.Testing Instructions for Keyboard
Use Tab to reach the post's Author control and change the selection with the keyboard. Confirm the name and avatar update, and the avatar adds no tab stop.
Screenshots
Captured in a disposable WordPress Playground site with Twenty Twenty-Five and demo data. Each pair uses a 1440 × 1000 viewport, the same view and data, and a fixed browser clock. Images are cropped to the affected interface. Before is
47d76d8364e; after isf89677e8a5a. After captures wait for visible images to finish loading and displaying. The Pages and media picker examples include loaded, missing, and failed avatar images; the revision timeline includes an unnamed author.Site Editor
Pages
Templates
Template Parts
Extensible Site Editor
Pages
Templates
Template Parts
Post editor
Post inspector with DataForm enabled
Revision timeline
Recaptured after the Gravatar image loaded successfully in both builds. The missing-image row shows the fallback.
Media
Media picker with DataViews enabled
Media Editor details
Initials at all sizes
Isolated composition of the compiled Avatar with its native initials fallback in all five sizes and both shapes. The 16px avatar uses the component's default 8px initials.
Image priority with missing or blank names
Matched fixture using the compiled post, template-user, and media author renderers with production styles and the same demo inputs. Before is
09651df8820; after isf89677e8a5a. Valid images use the demo SVG portrait. Failed requests return an actual 404.Verification
use-with-caution. These packages already bundle@wordpress/ui; the imports include the same explicit lint exemption used by other bundled consumers.Use of AI Tools
Implemented and verified with OpenAI Codex.