-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed
Labels
[Feature] Block APIAPI that allows to express the block paradigm.API that allows to express the block paradigm.[Feature] ExtensibilityThe ability to extend blocks or the editing experienceThe ability to extend blocks or the editing experience[Type] EnhancementA suggestion for improvement.A suggestion for improvement.
Description
An example request regarding this documentation page: https://github.com/WordPress/gutenberg/tree/master/editor/components/inner-blocks
wp.blocks.registerBlockType( 'example/hello-world', {
title: 'Hello World',
icon: 'universal-access-alt',
category: 'layout',
attributes: {},
edit: function(){
return wp.element.createElement( wp.editor.InnerBlocks );
},
save: function(){
return null;
},
});
// This function is wrong and needs documentation.
function php_render_block( $attributes, $content = '' ) {
// #1 How do I access InnerBlocks.Content here?
// #2 When accessed how do I typically parse all InnerBlocks.Content?
return '<p>' . $attributes['foo'] . '</p>' . '<pre><code>' . htmlspecialchars( $content ) . '</code></pre>';
}
Similar example:
https://gist.github.com/mattheu/7cf235b4f932de891bc21cb5f3ff3de6
aceArt-GmbH and kohey821
Metadata
Metadata
Assignees
Labels
[Feature] Block APIAPI that allows to express the block paradigm.API that allows to express the block paradigm.[Feature] ExtensibilityThe ability to extend blocks or the editing experienceThe ability to extend blocks or the editing experience[Type] EnhancementA suggestion for improvement.A suggestion for improvement.