显示与当前帖子相邻的下一个或上一个帖子链接。
属性
通过 block.json 中的 attributes 属性定义。
| 属性 | 类型 | 默认值 | 描述 |
|---|---|---|---|
type | string | "next" | — |
label | string | — | 角色: content |
showTitle | boolean | false | — |
linkLabel | boolean | false | — |
arrow | string | "none" | — |
taxonomy | string | "" | — |
支持功能
通过 block.json 中的 supports 属性定义。
anchor:truereusable:falsehtml:falsecolor:link:true
typography:fontSize:truelineHeight:truetextAlign:true
shadow:trueinteractivity:clientNavigation:true
spacing:margin:truepadding:true
上下文
通过 block.json 中的 usesContext 和 providesContext 属性定义。
使用的上下文:
postType
CSS 选择器
通过 block.json 中的 selectors 属性定义。
- 边框:
.wp-block-post-navigation-link:not(:empty) - 阴影:
.wp-block-post-navigation-link:not(:empty) - 间距:
.wp-block-post-navigation-link:not(:empty)
块标记
这是一个 动态块。它在服务器上渲染,不会在帖子内容中保存 HTML。
在帖子内容中,它存储为块注释:
<!-- wp:post-navigation-link {"type":"next"} /-->
来源
- block.json (参考)
- 源代码目录 — 浏览
edit和save源文件、index.php等。