Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Text Columns block from insertion menus #8036

Merged
merged 2 commits into from
Jul 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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