From ae36680712df29f37b3f92225f118e0fec0113f3 Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Wed, 7 Dec 2022 13:01:35 +0100 Subject: [PATCH] Remove small APIs marked to be removed in WP 6.2 (#46106) --- .../src/components/rich-text/index.js | 2 -- .../src/components/rich-text/index.native.js | 2 -- .../src/components/rich-text/utils.js | 23 ++----------------- packages/server-side-render/src/index.js | 14 +---------- 4 files changed, 3 insertions(+), 38 deletions(-) diff --git a/packages/block-editor/src/components/rich-text/index.js b/packages/block-editor/src/components/rich-text/index.js index 8378c3718d33f..726f8cddfff7b 100644 --- a/packages/block-editor/src/components/rich-text/index.js +++ b/packages/block-editor/src/components/rich-text/index.js @@ -98,7 +98,6 @@ function RichTextWrapper( onReplace, placeholder, allowedFormats, - formattingControls, withoutInteractiveFormatting, onRemove, onMerge, @@ -166,7 +165,6 @@ function RichTextWrapper( const multilineTag = getMultilineTag( multiline ); const adjustedAllowedFormats = getAllowedFormats( { allowedFormats, - formattingControls, disableFormats, } ); const hasFormats = diff --git a/packages/block-editor/src/components/rich-text/index.native.js b/packages/block-editor/src/components/rich-text/index.native.js index 45826129017a8..1ea26ddcf7775 100644 --- a/packages/block-editor/src/components/rich-text/index.native.js +++ b/packages/block-editor/src/components/rich-text/index.native.js @@ -75,7 +75,6 @@ function RichTextWrapper( onReplace, placeholder, allowedFormats, - formattingControls, withoutInteractiveFormatting, onRemove, onMerge, @@ -194,7 +193,6 @@ function RichTextWrapper( const multilineTag = getMultilineTag( multiline ); const adjustedAllowedFormats = getAllowedFormats( { allowedFormats, - formattingControls, disableFormats, } ); const hasFormats = diff --git a/packages/block-editor/src/components/rich-text/utils.js b/packages/block-editor/src/components/rich-text/utils.js index 6c8275d930eeb..323af1c6c36e0 100644 --- a/packages/block-editor/src/components/rich-text/utils.js +++ b/packages/block-editor/src/components/rich-text/utils.js @@ -2,7 +2,6 @@ * WordPress dependencies */ import { regexp } from '@wordpress/shortcode'; -import deprecated from '@wordpress/deprecated'; import { renderToString } from '@wordpress/element'; import { createBlock } from '@wordpress/blocks'; @@ -34,30 +33,12 @@ export function getMultilineTag( multiline ) { return multiline === true ? 'p' : multiline; } -export function getAllowedFormats( { - allowedFormats, - formattingControls, - disableFormats, -} ) { +export function getAllowedFormats( { allowedFormats, disableFormats } ) { if ( disableFormats ) { return getAllowedFormats.EMPTY_ARRAY; } - if ( ! allowedFormats && ! formattingControls ) { - return; - } - - if ( allowedFormats ) { - return allowedFormats; - } - - deprecated( 'wp.blockEditor.RichText formattingControls prop', { - since: '5.4', - alternative: 'allowedFormats', - version: '6.2', - } ); - - return formattingControls.map( ( name ) => `core/${ name }` ); + return allowedFormats; } getAllowedFormats.EMPTY_ARRAY = []; diff --git a/packages/server-side-render/src/index.js b/packages/server-side-render/src/index.js index 80e0033707cd9..6dcdc31f46109 100644 --- a/packages/server-side-render/src/index.js +++ b/packages/server-side-render/src/index.js @@ -1,9 +1,8 @@ /** * WordPress dependencies */ -import { useMemo, forwardRef } from '@wordpress/element'; +import { useMemo } from '@wordpress/element'; import { withSelect } from '@wordpress/data'; -import deprecated from '@wordpress/deprecated'; /** * Internal dependencies @@ -47,15 +46,4 @@ const ExportedServerSideRender = withSelect( ( select ) => { return ; } ); -if ( window && window.wp && window.wp.components ) { - window.wp.components.ServerSideRender = forwardRef( ( props, ref ) => { - deprecated( 'wp.components.ServerSideRender', { - version: '6.2', - since: '5.3', - alternative: 'wp.serverSideRender', - } ); - return ; - } ); -} - export default ExportedServerSideRender;