最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to replace the Gutenberg default block with a custom block?

programmeradmin3浏览0评论

I need to replace the Gutenberg default block (paragraph) with a custom block. In particular, every new post should start with the custom block instead of the default paragraph, and more generally the default block should substitute the default paragraph in every case a new paragraph is created/appended.

I guess the custom block would need a paragraph-like interface, but that's not a problem as my custom block is largely based on the core/paragraph itself.

Things I've tried

setDefaultBlockName (docs)

It just doesn't work, see this related GitHub issue. Funnily enough, calling getDefaultBlockName immediately after setting it returns the custom block as expected, but apparently nothing else changes. I guess the functionality is just missing.

发布评论

评论列表(0)

  1. 暂无评论