Skip to content

Commit

Permalink
Plugin: Remove deprecated APIs that are no longer supported in versio…
Browse files Browse the repository at this point in the history
…n 11.0 (#33258)
  • Loading branch information
gziolo authored and getdave committed Jul 7, 2021
1 parent 4f02d82 commit 7924ceb
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 38 deletions.
4 changes: 4 additions & 0 deletions packages/blocks/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 0 additions & 15 deletions packages/blocks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -713,21 +713,6 @@ _Returns_

- `?WPBlock`: The block, if it has been successfully registered; otherwise `undefined`.

<a name="registerBlockTypeFromMetadata" href="#registerBlockTypeFromMetadata">#</a> **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`.

<a name="registerBlockVariation" href="#registerBlockVariation">#</a> **registerBlockVariation**

Registers a new block variation for the given block type.
Expand Down
1 change: 0 additions & 1 deletion packages/blocks/src/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ export { getCategories, setCategories, updateCategory } from './categories';
// children of another block.
export {
registerBlockType,
registerBlockTypeFromMetadata,
registerBlockCollection,
unregisterBlockType,
setFreeformContentHandlerName,
Expand Down
22 changes: 0 additions & 22 deletions packages/blocks/src/api/registration.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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.
*
Expand Down

0 comments on commit 7924ceb

Please sign in to comment.