From 7924cebfeeb2fdb075ff057f7dbbe8fde974674e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Zi=C3=B3=C5=82kowski?= Date: Wed, 7 Jul 2021 13:42:02 +0200 Subject: [PATCH] Plugin: Remove deprecated APIs that are no longer supported in version 11.0 (#33258) --- packages/blocks/CHANGELOG.md | 4 ++++ packages/blocks/README.md | 15 --------------- packages/blocks/src/api/index.js | 1 - packages/blocks/src/api/registration.js | 22 ---------------------- 4 files changed, 4 insertions(+), 38 deletions(-) diff --git a/packages/blocks/CHANGELOG.md b/packages/blocks/CHANGELOG.md index d0f78b62e5e5cc..83a96ddaddc5e9 100644 --- a/packages/blocks/CHANGELOG.md +++ b/packages/blocks/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### Breaking Changes + +- The deprecated `registerBlockTypeFromMetadata` function was removed. Please use `registerBlockType` that covers the same functionality ([#32030](https://github.com/WordPress/gutenberg/pull/32030)). + ## 9.1.0 (2021-05-20) ### New API diff --git a/packages/blocks/README.md b/packages/blocks/README.md index 4b7109bd1fe311..22c6a6db40cb9e 100644 --- a/packages/blocks/README.md +++ b/packages/blocks/README.md @@ -713,21 +713,6 @@ _Returns_ - `?WPBlock`: The block, if it has been successfully registered; otherwise `undefined`. -# **registerBlockTypeFromMetadata** - -> **Deprecated** Use `registerBlockType` instead. - -Registers a new block provided from metadata stored in `block.json` file. - -_Parameters_ - -- _metadata_ `Object`: Block metadata loaded from `block.json`. -- _additionalSettings_ `Object`: Additional block settings. - -_Returns_ - -- `?WPBlock`: The block, if it has been successfully registered; otherwise `undefined`. - # **registerBlockVariation** Registers a new block variation for the given block type. diff --git a/packages/blocks/src/api/index.js b/packages/blocks/src/api/index.js index 073fee3396cc98..0cba447e71736a 100644 --- a/packages/blocks/src/api/index.js +++ b/packages/blocks/src/api/index.js @@ -108,7 +108,6 @@ export { getCategories, setCategories, updateCategory } from './categories'; // children of another block. export { registerBlockType, - registerBlockTypeFromMetadata, registerBlockCollection, unregisterBlockType, setFreeformContentHandlerName, diff --git a/packages/blocks/src/api/registration.js b/packages/blocks/src/api/registration.js index 924267b9ad07c8..c253f34f04d1a8 100644 --- a/packages/blocks/src/api/registration.js +++ b/packages/blocks/src/api/registration.js @@ -22,7 +22,6 @@ import { /** * WordPress dependencies */ -import deprecated from '@wordpress/deprecated'; import { applyFilters } from '@wordpress/hooks'; import { select, dispatch } from '@wordpress/data'; import { _x } from '@wordpress/i18n'; @@ -424,27 +423,6 @@ function translateBlockSettingUsingI18nSchema( return settingValue; } -/** - * Registers a new block provided from metadata stored in `block.json` file. - * - * @deprecated Use `registerBlockType` instead. - * - * @param {Object} metadata Block metadata loaded from `block.json`. - * @param {Object} additionalSettings Additional block settings. - * - * @return {?WPBlock} The block, if it has been successfully registered; - * otherwise `undefined`. - */ -export function registerBlockTypeFromMetadata( metadata, additionalSettings ) { - deprecated( 'wp.blocks.registerBlockTypeFromMetadata', { - since: '10.7', - plugin: 'Gutenberg', - alternative: 'wp.blocks.registerBlockType', - version: '11.0', - } ); - return registerBlockType( metadata, additionalSettings ); -} - /** * Registers a new block collection to group blocks in the same namespace in the inserter. *