显示链接到您社交资料或网站的图标。
块关系
允许的内部块:
– core/social-link
属性
通过 attributes 属性在 block.json 中定义。
| 属性 | 类型 | 默认值 | 描述 |
|---|---|---|---|
iconColor | string | — | — |
customIconColor | string | — | — |
iconColorValue | string | — | — |
iconBackgroundColor | string | — | — |
customIconBackgroundColor | string | — | — |
iconBackgroundColorValue | string | — | — |
openInNewTab | boolean | false | — |
showLabels | boolean | false | — |
size | string | — | — |
支持功能
通过 supports 属性在 block.json 中定义。
align:"left","center","right"anchor:truehtml:falselayout:allowSwitching:falseallowInheriting:falseallowVerticalAlignment:falsedefault:{"type":"flex"}
background:gradient:true
color:enableContrastChecker:falsebackground:truegradients:truetext:false
spacing:blockGap:["horizontal","vertical"]margin:truepadding:trueunits:["px","em","rem","vh","vw"]
interactivity:clientNavigation:true
shadow:truecontentRole:truelistView:true
上下文
通过 usesContext 和 providesContext 属性在 block.json 中定义。
提供上下文:
openInNewTab→ 属性openInNewTabshowLabels→ 属性showLabelsiconColor→ 属性iconColoriconColorValue→ 属性iconColorValueiconBackgroundColor→ 属性iconBackgroundColoriconBackgroundColorValue→ 属性iconBackgroundColorValue
块样式
通过 styles 属性在 block.json 中定义。
| 样式名称 | 标签 | 默认值 |
|---|---|---|
default | 默认 | 是 |
logos-only | 仅徽标 | 否 |
pill-shape | 胶囊形状 | 否 |
块标记
这是一个 静态块。标记直接保存在文章内容中。
<!-- wp:social-links -->
<ul class="wp-block-social-links"><!-- wp:social-link {"service":"mastodon","url":"https://mastodon.social/@marcuskaz"} /--></ul>
<!-- /wp:social-links -->
来源
- block.json (参考)
- 源代码目录 — 浏览
edit和save源文件,index.php等。