显示链接到您社交资料或网站的图标。

  • 名称: core/social-links
  • 类别: 小部件
  • API 版本: 3
  • 块类型: 静态(保存在文章内容中)
  • 关键词: links

块关系

允许的内部块:
– core/social-link

属性

通过 attributes 属性在 block.json 中定义。

属性类型默认值描述
iconColorstring——
customIconColorstring——
iconColorValuestring——
iconBackgroundColorstring——
customIconBackgroundColorstring——
iconBackgroundColorValuestring——
openInNewTabbooleanfalse—
showLabelsbooleanfalse—
sizestring——

支持功能

通过 supports 属性在 block.json 中定义。

上下文

通过 usesContext 和 providesContext 属性在 block.json 中定义。

提供上下文:

  • openInNewTab → 属性 openInNewTab
  • showLabels → 属性 showLabels
  • iconColor → 属性 iconColor
  • iconColorValue → 属性 iconColorValue
  • iconBackgroundColor → 属性 iconBackgroundColor
  • iconBackgroundColorValue → 属性 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 -->

来源