diff --git a/docs/block-api.md b/docs/block-api.md index 01b2295b46de0b..388982c4f10517 100644 --- a/docs/block-api.md +++ b/docs/block-api.md @@ -106,7 +106,7 @@ icon: { * **Type:** `Array` -Sometimes a block could have aliases that help users discover it while searching. For example, an `image` block could also want to be discovered by `photo`. You can do so by providing an array of terms (which can be translated). It is only allowed to add as much as three terms per block. +Sometimes a block could have aliases that help users discover it while searching. For example, an `image` block could also want to be discovered by `photo`. You can do so by providing an array of terms (which can be translated). ```js // Make it easier to discover a block with keyword aliases. @@ -124,18 +124,18 @@ Block styles can be used to provide alternative styles to block. It works by add // Register block styles. styles: [ // Mark style as default. - { - name: 'default', - label: __( 'Rounded' ), - isDefault: true + { + name: 'default', + label: __( 'Rounded' ), + isDefault: true }, - { - name: 'outline', - label: __( 'Outline' ) + { + name: 'outline', + label: __( 'Outline' ) }, - { - name: 'squared', - label: __( 'Squared' ) + { + name: 'squared', + label: __( 'Squared' ) }, ], ``` diff --git a/packages/blocks/src/api/registration.js b/packages/blocks/src/api/registration.js index 6dab1300e6119e..8f16dce49e21b3 100644 --- a/packages/blocks/src/api/registration.js +++ b/packages/blocks/src/api/registration.js @@ -1,4 +1,4 @@ -/* eslint no-console: [ 'error', { allow: [ 'error', 'warn' ] } ] */ +/* eslint no-console: [ 'error', { allow: [ 'error' ] } ] */ /** * External dependencies @@ -140,13 +140,6 @@ export function registerBlockType( name, settings ) { return; } - if ( 'keywords' in settings && settings.keywords.length > 3 ) { - console.warn( - 'The block "' + name + '" can have a maximum of 3 keywords.' - ); - settings.keywords = settings.keywords.slice( 0, 3 ); - } - dispatch( 'core/blocks' ).addBlockTypes( settings ); return settings; diff --git a/packages/blocks/src/api/test/registration.js b/packages/blocks/src/api/test/registration.js index e881943d5168ee..f7b20bcda9db07 100644 --- a/packages/blocks/src/api/test/registration.js +++ b/packages/blocks/src/api/test/registration.js @@ -119,13 +119,6 @@ describe( 'blocks', () => { expect( block ).toBeUndefined(); } ); - it( 'should reject blocks with more than 3 keywords', () => { - const blockType = { save: noop, keywords: [ 'apple', 'orange', 'lemon', 'pineapple' ], category: 'common', title: 'block title' }, - block = registerBlockType( 'my-plugin/fancy-block-7', blockType ); - expect( console ).toHaveErroredWith( 'The block "my-plugin/fancy-block-7" can have a maximum of 3 keywords.' ); - expect( block ).toBeUndefined(); - } ); - it( 'should reject blocks without category', () => { const blockType = { settingName: 'settingValue', save: noop, title: 'block title' }, block = registerBlockType( 'my-plugin/fancy-block-8', blockType );