Add a user’s avatar.
Attributes
Defined via the attributes property in block.json.
| Attribute | Type | Default | Description |
|---|---|---|---|
userId |
number |
— | — |
size |
number |
96 |
— |
isLink |
boolean |
false |
— |
linkTarget |
string |
"_self" |
— |
Supports
Defined via the supports property in block.json.
anchor:truehtml:falsealign:truealignWide:falsespacing:margin:truepadding:true
color:text:falsebackground:false
filter:duotone:true
interactivity:clientNavigation:true
Context
Defined via the usesContext and providesContext properties in block.json.
Uses context:
postTypepostIdcommentId
CSS Selectors
Defined via the selectors property in block.json.
- border:
.wp-block-avatar img - filter:
- duotone:
.wp-block-avatar img
- duotone:
Block Markup
This is a dynamic block. It is rendered on the server and does not save HTML in post content.
In post content, it is stored as a block comment:
<!-- wp:avatar {"userId":4, "size":85,"isLink":true,"align":"right","style":{"spacing":{"margin":{"bottom":"40px"}},"border":{"radius":"47px","width":"3px"},"color":{"duotone":["#000000","#ffe2c7"]}},"borderColor":"vivid-red"} /-->
Source
- block.json (reference)
- Source directory — browse
edit.js,save.js,index.php, and more.