Are there any plans to add "callout" or "admonition" block in core? #44692
-
Questions
Usage in wordpress docshttps://make.wordpress.org/core/2021/09/27/changes-to-the-wordpress-core-php-test-suite/ BackgroundI think the "callout" block is a widely and frequently used block, so I wanted to know if I should implement it independently or if there are plans to implement it in the core.
https://www.notion.vip/notion-update-use-blocks-within-callouts/ |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
It does seems like something that can be achieved as a block pattern rather than a block, so I'm not sure that it would be added as a core block. There are also some options being explored to make container blocks feel more cohesive in terms of editing - #43037. So I think this could reduce the need to add a callout block type. |
Beta Was this translation helpful? Give feedback.
-
For future readers...
Share the code. wp.domReady(function () {
wp.blocks.registerBlockVariation("core/group", {
name: "callout",
title: "Callout",
attributes: {
style: {
border: { left: { color: "#00a0d2", width: "6px" } },
color: { background: "#e5f5fa" },
spacing: {
padding: { left: "1.5rem", right: "1.5rem" },
},
},
},
innerBlocks: [
[
"core/paragraph",
{
content: "💡 <strong>Title</strong>",
},
],
[
"core/paragraph",
{
content: "",
},
],
],
}); |
Beta Was this translation helpful? Give feedback.
It does seems like something that can be achieved as a block pattern rather than a block, so I'm not sure that it would be added as a core block.
There are also some options being explored to make container blocks feel more cohesive in terms of editing - #43037. So I think this could reduce the need to add a callout block type.