Skip to content

Commit

Permalink
Remove support for heading block
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin940726 committed Nov 16, 2023
1 parent efe217e commit ddc83d8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
1 change: 0 additions & 1 deletion lib/experimental/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ function gutenberg_render_block_connections( $block_content, $block, $block_inst
$blocks_attributes_allowlist = array(
'core/paragraph' => array( 'content' ),
'core/image' => array( 'url' ),
'core/heading' => array( 'content' ),
);

// Whitelist of the block types that support block connections.
Expand Down
7 changes: 1 addition & 6 deletions packages/block-editor/src/hooks/custom-fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,7 @@ const withCustomFieldsControls = createHigherOrderComponent( ( BlockEdit ) => {

// Check if the current block is a paragraph or image block.
// Currently, only these two blocks are supported.
if (
! [ 'core/paragraph', 'core/image', 'core/heading' ].includes(
props.name
)
) {
if ( ! [ 'core/paragraph', 'core/image' ].includes( props.name ) ) {
return <BlockEdit { ...props } />;
}

Expand All @@ -70,7 +66,6 @@ const withCustomFieldsControls = createHigherOrderComponent( ( BlockEdit ) => {
let attributeName;
if ( props.name === 'core/paragraph' ) attributeName = 'content';
if ( props.name === 'core/image' ) attributeName = 'url';
if ( props.name === 'core/heading' ) attributeName = 'content';

const connectionSource =
props.attributes?.connections?.attributes?.[ attributeName ]
Expand Down
5 changes: 2 additions & 3 deletions packages/block-library/src/heading/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"content": {
"type": "string",
"source": "html",
"selector": "h2",
"selector": "h1,h2,h3,h4,h5,h6",
"default": "",
"__experimentalRole": "content"
},
Expand Down Expand Up @@ -63,8 +63,7 @@
}
},
"__unstablePasteTextInline": true,
"__experimentalSlashInserter": true,
"__experimentalConnections": true
"__experimentalSlashInserter": true
},
"editorStyle": "wp-block-heading-editor",
"style": "wp-block-heading"
Expand Down

0 comments on commit ddc83d8

Please sign in to comment.