属性
通过 block.json 中的 attributes 属性定义。
| 属性 | 类型 | 默认值 | 描述 |
|---|---|---|---|
textAlign | string | — | — |
avatarSize | number | 48 | — |
showAvatar | boolean | true | — |
showBio | boolean | — | — |
byline | string | — | — |
isLink | boolean | false | 角色:content |
linkTarget | string | "_self" | 角色:content |
支持功能
通过 block.json 中的 supports 属性定义。
inserter:falseanchor:truehtml:falsespacing:margin:truepadding:true
typography:fontSize:truelineHeight:true
color:interactivity:clientNavigation:true
filter:duotone:true
上下文
通过 block.json 中的 usesContext 和 providesContext 属性定义。
使用的上下文:
postTypepostIdqueryId
CSS 选择器
通过 block.json 中的 selectors 属性定义。
- filter:
- duotone:
.wp-block-post-author .wp-block-post-author__avatar img
- duotone:
区块标记
这是一个 动态区块。它在服务器上渲染,不会将 HTML 保存到帖子内容中。
在帖子内容中,它存储为区块注释:
<!-- wp:post-author /-->
来源
- block.json (参考)
- 源代码目录 — 浏览
edit和save源文件、index.php等。