Skip to content

Commit

Permalink
Remove Text Columns block from insertion menus (#8036)
Browse files Browse the repository at this point in the history
* Removes Text Columns block from insertion menus.
* Adds a deprecation warning when loading Text Columns blocks.
  • Loading branch information
brandonpayton authored Jul 19, 2018
1 parent 3820480 commit e8beea5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
11 changes: 11 additions & 0 deletions core-blocks/text-columns/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
InspectorControls,
RichText,
} from '@wordpress/editor';
import deprecated from '@wordpress/deprecated';

/**
* Internal dependencies
Expand All @@ -25,6 +26,11 @@ import './editor.scss';
export const name = 'core/text-columns';

export const settings = {
// Disable insertion as this block is deprecated and ultimately replaced by the Columns block.
supports: {
inserter: false,
},

title: __( 'Text Columns' ),

description: __( 'Add text, and display it in two or more columns. Like a newspaper! This block is experimental.' ),
Expand Down Expand Up @@ -64,6 +70,11 @@ export const settings = {
edit: ( ( { attributes, setAttributes, className } ) => {
const { width, content, columns } = attributes;

deprecated( 'The Text Columns block', {
alternative: 'the Columns block',
plugin: 'Gutenberg',
} );

return (
<Fragment>
<BlockControls>
Expand Down
3 changes: 3 additions & 0 deletions core-blocks/text-columns/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@ describe( 'core/text-columns', () => {
const wrapper = blockEditRender( name, settings );

expect( wrapper ).toMatchSnapshot();
expect( console ).toHaveWarnedWith(
'The Text Columns block is deprecated and will be removed. Please use the Columns block instead.'
);
} );
} );
1 change: 1 addition & 0 deletions docs/reference/deprecated.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Gutenberg's deprecation policy is intended to support backwards-compatibility fo
- All references to a block's `uid` have been replaced with equivalent props and selectors for `clientId`.
- The `wp.editor.MediaPlaceholder` component `onSelectUrl` prop has been renamed to `onSelectURL`.
- The `wp.editor.UrlInput` component has been renamed to `wp.editor.URLInput`.
- The Text Columns block has been removed. Please use the Columns block instead.

## 3.4.0

Expand Down

0 comments on commit e8beea5

Please sign in to comment.