diff --git a/packages/block-editor/src/components/block-card/index.js b/packages/block-editor/src/components/block-card/index.js index 60f8616b5f49dd..21832629b9557f 100644 --- a/packages/block-editor/src/components/block-card/index.js +++ b/packages/block-editor/src/components/block-card/index.js @@ -11,6 +11,7 @@ import BlockIcon from '../block-icon'; function BlockCard( { title, icon, description, blockType } ) { if ( blockType ) { deprecated( '`blockType` property in `BlockCard component`', { + since: '5.7', alternative: '`title, icon and description` properties', } ); ( { title, icon, description } = blockType ); diff --git a/packages/block-editor/src/components/block-list/block-wrapper.js b/packages/block-editor/src/components/block-list/block-wrapper.js index 469b77c3e34a52..a06a644320cda9 100644 --- a/packages/block-editor/src/components/block-list/block-wrapper.js +++ b/packages/block-editor/src/components/block-list/block-wrapper.js @@ -13,6 +13,7 @@ import { useBlockProps } from './use-block-props'; const BlockComponent = forwardRef( ( { children, tagName: TagName = 'div', ...props }, ref ) => { deprecated( 'wp.blockEditor.__experimentalBlock', { + since: '5.6', alternative: 'wp.blockEditor.useBlockProps', } ); const blockProps = useBlockProps( { ...props, ref } ); diff --git a/packages/block-editor/src/components/media-placeholder/index.js b/packages/block-editor/src/components/media-placeholder/index.js index c602c4ca8fea72..b460e20755e57e 100644 --- a/packages/block-editor/src/components/media-placeholder/index.js +++ b/packages/block-editor/src/components/media-placeholder/index.js @@ -391,6 +391,7 @@ export function MediaPlaceholder( { if ( dropZoneUIOnly || disableMediaButtons ) { if ( dropZoneUIOnly ) { deprecated( 'wp.blockEditor.MediaPlaceholder dropZoneUIOnly prop', { + since: '5.4', alternative: 'disableMediaButtons', } ); } diff --git a/packages/block-editor/src/components/navigable-toolbar/index.js b/packages/block-editor/src/components/navigable-toolbar/index.js index aa516640ae7365..b01220d6461aaf 100644 --- a/packages/block-editor/src/components/navigable-toolbar/index.js +++ b/packages/block-editor/src/components/navigable-toolbar/index.js @@ -61,6 +61,7 @@ function useIsAccessibleToolbar( ref ) { const onlyToolbarItem = hasOnlyToolbarItem( tabbables ); if ( ! onlyToolbarItem ) { deprecated( 'Using custom components as toolbar controls', { + since: '5.6', alternative: 'ToolbarItem or ToolbarButton components', link: 'https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols', diff --git a/packages/block-editor/src/components/preserve-scroll-in-reorder/index.js b/packages/block-editor/src/components/preserve-scroll-in-reorder/index.js index f9e9650d93f0de..37da4295a062e1 100644 --- a/packages/block-editor/src/components/preserve-scroll-in-reorder/index.js +++ b/packages/block-editor/src/components/preserve-scroll-in-reorder/index.js @@ -5,6 +5,7 @@ import deprecated from '@wordpress/deprecated'; export default function PreserveScrollInReorder() { deprecated( 'PreserveScrollInReorder component', { + since: '5.4', hint: 'This behavior is now built-in the block list', } ); return null; diff --git a/packages/block-editor/src/components/rich-text/index.js b/packages/block-editor/src/components/rich-text/index.js index 11da84a07c7fb8..4a4e53b2877b49 100644 --- a/packages/block-editor/src/components/rich-text/index.js +++ b/packages/block-editor/src/components/rich-text/index.js @@ -101,6 +101,7 @@ function getAllowedFormats( { } deprecated( 'wp.blockEditor.RichText formattingControls prop', { + since: '5.4', alternative: 'allowedFormats', } ); @@ -716,6 +717,7 @@ function RichTextWrapper( } deprecated( 'wp.blockEditor.RichText wrapperClassName prop', { + since: '5.4', alternative: 'className prop or create your own wrapper div', } ); diff --git a/packages/block-editor/src/store/actions.js b/packages/block-editor/src/store/actions.js index 7fd0555881e346..aad215e14ae50c 100644 --- a/packages/block-editor/src/store/actions.js +++ b/packages/block-editor/src/store/actions.js @@ -574,6 +574,8 @@ export function* insertBlocks( meta = initialPosition; initialPosition = 0; deprecated( "meta argument in wp.data.dispatch('core/block-editor')", { + since: '10.1', + plugin: 'Gutenberg', hint: 'The meta argument is now the 6th argument of the function', } ); } diff --git a/packages/block-library/src/text-columns/edit.js b/packages/block-library/src/text-columns/edit.js index ec69c75e1a4a9e..d9e2a0c6c1fd9f 100644 --- a/packages/block-library/src/text-columns/edit.js +++ b/packages/block-library/src/text-columns/edit.js @@ -21,8 +21,8 @@ export default function TextColumnsEdit( { attributes, setAttributes } ) { const { width, content, columns } = attributes; deprecated( 'The Text Columns block', { + since: '5.3', alternative: 'the Columns block', - plugin: 'Gutenberg', } ); return ( diff --git a/packages/blocks/src/api/raw-handling/index.js b/packages/blocks/src/api/raw-handling/index.js index 3d062892e7fa7f..cc2c48fb80584c 100644 --- a/packages/blocks/src/api/raw-handling/index.js +++ b/packages/blocks/src/api/raw-handling/index.js @@ -26,6 +26,7 @@ export { pasteHandler } from './paste-handler'; export function deprecatedGetPhrasingContentSchema( context ) { deprecated( 'wp.blocks.getPhrasingContentSchema', { + since: '5.6', alternative: 'wp.dom.getPhrasingContentSchema', } ); return getPhrasingContentSchema( context ); diff --git a/packages/components/src/button/deprecated.js b/packages/components/src/button/deprecated.js index 6c676d00215811..34e99bd71f54a5 100644 --- a/packages/components/src/button/deprecated.js +++ b/packages/components/src/button/deprecated.js @@ -11,6 +11,7 @@ import Button from '../button'; function IconButton( { labelPosition, size, tooltip, label, ...props }, ref ) { deprecated( 'wp.components.IconButton', { + since: '5.4', alternative: 'wp.components.Button', } ); diff --git a/packages/components/src/button/index.js b/packages/components/src/button/index.js index 3af63e473d21fc..3415fb2a276369 100644 --- a/packages/components/src/button/index.js +++ b/packages/components/src/button/index.js @@ -51,6 +51,7 @@ export function Button( props, ref ) { if ( isDefault ) { deprecated( 'Button isDefault prop', { + since: '5.4', alternative: 'isSecondary', } ); } diff --git a/packages/components/src/clipboard-button/index.js b/packages/components/src/clipboard-button/index.js index c0d969935451dd..f73ab80c11a3ad 100644 --- a/packages/components/src/clipboard-button/index.js +++ b/packages/components/src/clipboard-button/index.js @@ -26,6 +26,8 @@ export default function ClipboardButton( { ...buttonProps } ) { deprecated( 'wp.components.ClipboardButton', { + since: '10.3', + plugin: 'Gutenberg', alternative: 'wp.compose.useCopyToClipboard', } ); diff --git a/packages/components/src/dropdown-menu/index.js b/packages/components/src/dropdown-menu/index.js index 64778f9da3914c..45f4e67c613c6d 100644 --- a/packages/components/src/dropdown-menu/index.js +++ b/packages/components/src/dropdown-menu/index.js @@ -54,15 +54,15 @@ function DropdownMenu( { } ) { if ( menuLabel ) { deprecated( '`menuLabel` prop in `DropdownComponent`', { + since: '5.3', alternative: '`menuProps` object and its `aria-label` property', - plugin: 'Gutenberg', } ); } if ( position ) { deprecated( '`position` prop in `DropdownComponent`', { + since: '5.3', alternative: '`popoverProps` object and its `position` property', - plugin: 'Gutenberg', } ); } diff --git a/packages/components/src/guide/index.js b/packages/components/src/guide/index.js index f16cd25456494d..dc0a4f22613e51 100644 --- a/packages/components/src/guide/index.js +++ b/packages/components/src/guide/index.js @@ -32,6 +32,7 @@ export default function Guide( { useEffect( () => { if ( Children.count( children ) ) { deprecated( 'Passing children to ', { + since: '5.5', alternative: 'the `pages` prop', } ); } diff --git a/packages/components/src/guide/page.js b/packages/components/src/guide/page.js index 18014f4548f2ed..2b8cec1af5492c 100644 --- a/packages/components/src/guide/page.js +++ b/packages/components/src/guide/page.js @@ -7,6 +7,7 @@ import deprecated from '@wordpress/deprecated'; export default function GuidePage( props ) { useEffect( () => { deprecated( '', { + since: '5.5', alternative: 'the `pages` prop in ', } ); }, [] ); diff --git a/packages/components/src/higher-order/with-focus-return/index.js b/packages/components/src/higher-order/with-focus-return/index.js index c2a5db9a87a2ed..8f585c9b4d7178 100644 --- a/packages/components/src/higher-order/with-focus-return/index.js +++ b/packages/components/src/higher-order/with-focus-return/index.js @@ -54,6 +54,7 @@ export default createHigherOrderComponent( ( options ) => { export const Provider = ( { children } ) => { deprecated( 'wp.components.FocusReturnProvider component', { + since: '5.7', hint: 'This provider is not used anymore. You can just remove it from your codebase', } ); diff --git a/packages/components/src/isolated-event-container/index.js b/packages/components/src/isolated-event-container/index.js index d3513953dd1314..4c856ff2a2019f 100644 --- a/packages/components/src/isolated-event-container/index.js +++ b/packages/components/src/isolated-event-container/index.js @@ -9,7 +9,9 @@ function stopPropagation( event ) { } export default forwardRef( ( { children, ...props }, ref ) => { - deprecated( 'wp.components.IsolatedEventContainer' ); + deprecated( 'wp.components.IsolatedEventContainer', { + since: '5.7', + } ); // Disable reason: this stops certain events from propagating outside of the component. // - onMouseDown is disabled as this can cause interactions with other DOM elements diff --git a/packages/components/src/modal/index.js b/packages/components/src/modal/index.js index 925f28be42525d..2144972d42f187 100644 --- a/packages/components/src/modal/index.js +++ b/packages/components/src/modal/index.js @@ -122,6 +122,7 @@ class Modal extends Component { if ( isDismissable ) { deprecated( 'isDismissable prop of the Modal component', { + since: '5.4', alternative: 'isDismissible prop (renamed) of the Modal component', } ); diff --git a/packages/components/src/popover/index.js b/packages/components/src/popover/index.js index 06e077f9e5c40d..0cb8a975344fad 100644 --- a/packages/components/src/popover/index.js +++ b/packages/components/src/popover/index.js @@ -544,6 +544,7 @@ const Popover = ( { } ); deprecated( 'Popover onClickOutside prop', { + since: '5.3', alternative: 'onFocusOutside', } ); diff --git a/packages/components/src/toolbar/index.js b/packages/components/src/toolbar/index.js index b94886bd9ce749..3bb887cc1fd335 100644 --- a/packages/components/src/toolbar/index.js +++ b/packages/components/src/toolbar/index.js @@ -28,6 +28,7 @@ import ToolbarContainer from './toolbar-container'; function Toolbar( { className, label, ...props }, ref ) { if ( ! label ) { deprecated( 'Using Toolbar without label prop', { + since: '5.6', alternative: 'ToolbarGroup component', link: 'https://developer.wordpress.org/block-editor/components/toolbar/', diff --git a/packages/compose/src/higher-order/with-global-events/index.js b/packages/compose/src/higher-order/with-global-events/index.js index 9c77c3ab2c4e5e..6e0a2ad57f7c6b 100644 --- a/packages/compose/src/higher-order/with-global-events/index.js +++ b/packages/compose/src/higher-order/with-global-events/index.js @@ -43,6 +43,7 @@ const listener = new Listener(); */ export default function withGlobalEvents( eventTypesToHandlers ) { deprecated( 'wp.compose.withGlobalEvents', { + since: '5.7', alternative: 'useEffect', } ); diff --git a/packages/compose/src/hooks/use-copy-on-click/index.js b/packages/compose/src/hooks/use-copy-on-click/index.js index 89f43193c5c2be..33a14c0224add3 100644 --- a/packages/compose/src/hooks/use-copy-on-click/index.js +++ b/packages/compose/src/hooks/use-copy-on-click/index.js @@ -24,6 +24,8 @@ import deprecated from '@wordpress/deprecated'; */ export default function useCopyOnClick( ref, text, timeout = 4000 ) { deprecated( 'wp.compose.useCopyOnClick', { + since: '10.3', + plugin: 'Gutenberg', alternative: 'wp.compose.useCopyToClipboard', } ); diff --git a/packages/core-data/src/resolvers.js b/packages/core-data/src/resolvers.js index f227c05fb21437..1d210f8a7b4b08 100644 --- a/packages/core-data/src/resolvers.js +++ b/packages/core-data/src/resolvers.js @@ -294,6 +294,7 @@ export function* getEmbedPreview( url ) { */ export function* hasUploadPermissions() { deprecated( "select( 'core' ).hasUploadPermissions()", { + since: '5.2', alternative: "select( 'core' ).canUser( 'create', 'media' )", } ); yield* canUser( 'create', 'media' ); diff --git a/packages/core-data/src/selectors.js b/packages/core-data/src/selectors.js index 5f4a9501f9bd54..8414a5b51c8c88 100644 --- a/packages/core-data/src/selectors.js +++ b/packages/core-data/src/selectors.js @@ -634,6 +634,7 @@ export function isPreviewEmbedFallback( state, url ) { */ export function hasUploadPermissions( state ) { deprecated( "select( 'core' ).hasUploadPermissions()", { + since: '5.2', alternative: "select( 'core' ).canUser( 'create', 'media' )", } ); return defaultTo( canUser( state, 'create', 'media' ), true ); diff --git a/packages/data-controls/src/index.js b/packages/data-controls/src/index.js index 3e9fa9e9b6c75b..62671b41f139ff 100644 --- a/packages/data-controls/src/index.js +++ b/packages/data-controls/src/index.js @@ -39,6 +39,7 @@ export function apiFetch( request ) { */ export function select( ...args ) { deprecated( '`select` control in `@wordpress/data-controls`', { + since: '5.7', alternative: 'built-in `resolveSelect` control in `@wordpress/data`', } ); @@ -53,6 +54,7 @@ export function select( ...args ) { */ export function syncSelect( ...args ) { deprecated( '`syncSelect` control in `@wordpress/data-controls`', { + since: '5.7', alternative: 'built-in `select` control in `@wordpress/data`', } ); @@ -67,6 +69,7 @@ export function syncSelect( ...args ) { */ export function dispatch( ...args ) { deprecated( '`dispatch` control in `@wordpress/data-controls`', { + since: '5.7', alternative: 'built-in `dispatch` control in `@wordpress/data`', } ); diff --git a/packages/data/src/plugins/controls/index.js b/packages/data/src/plugins/controls/index.js index cd247c0b911b31..d442dfa7c1f26c 100644 --- a/packages/data/src/plugins/controls/index.js +++ b/packages/data/src/plugins/controls/index.js @@ -5,6 +5,7 @@ import deprecated from '@wordpress/deprecated'; export default ( registry ) => { deprecated( 'wp.data.plugins.controls', { + since: '5.4', hint: 'The controls plugins is now baked-in.', } ); return registry; diff --git a/packages/editor/src/components/deprecated.js b/packages/editor/src/components/deprecated.js index 04962bf9dbe957..86f3f0b1d52901 100644 --- a/packages/editor/src/components/deprecated.js +++ b/packages/editor/src/components/deprecated.js @@ -65,6 +65,7 @@ export { default as ServerSideRender } from '@wordpress/server-side-render'; function deprecateComponent( name, Wrapped, staticsToHoist = [] ) { const Component = forwardRef( ( props, ref ) => { deprecated( 'wp.editor.' + name, { + since: '5.3', alternative: 'wp.blockEditor.' + name, } ); @@ -84,6 +85,7 @@ function deprecateComponent( name, Wrapped, staticsToHoist = [] ) { function deprecateFunction( name, func ) { return ( ...args ) => { deprecated( 'wp.editor.' + name, { + since: '5.3', alternative: 'wp.blockEditor.' + name, } ); diff --git a/packages/editor/src/components/global-keyboard-shortcuts/visual-editor-shortcuts.js b/packages/editor/src/components/global-keyboard-shortcuts/visual-editor-shortcuts.js index 67397065ab5e60..0b4e6ddbc6146d 100644 --- a/packages/editor/src/components/global-keyboard-shortcuts/visual-editor-shortcuts.js +++ b/packages/editor/src/components/global-keyboard-shortcuts/visual-editor-shortcuts.js @@ -44,8 +44,8 @@ export default VisualEditorGlobalKeyboardShortcuts; export function EditorGlobalKeyboardShortcuts() { deprecated( 'EditorGlobalKeyboardShortcuts', { + since: '5.2', alternative: 'VisualEditorGlobalKeyboardShortcuts', - plugin: 'Gutenberg', } ); return ; diff --git a/packages/editor/src/store/actions.js b/packages/editor/src/store/actions.js index 4bfdf46e81c8c9..ec712f1a9ee9f4 100644 --- a/packages/editor/src/store/actions.js +++ b/packages/editor/src/store/actions.js @@ -114,8 +114,8 @@ export function resetPost( post ) { */ export function* resetAutosave( newAutosave ) { deprecated( 'resetAutosave action (`core/editor` store)', { + since: '5.3', alternative: 'receiveAutosaves action (`core` store)', - plugin: 'Gutenberg', } ); const postId = yield controls.select( STORE_NAME, 'getCurrentPostId' ); @@ -161,6 +161,7 @@ export function __experimentalRequestPostUpdateFinish( options = {} ) { */ export function updatePost() { deprecated( "wp.data.dispatch( 'core/editor' ).updatePost", { + since: '5.7', alternative: 'User the core entitires store instead', } ); return { @@ -649,6 +650,7 @@ export function updateEditorSettings( settings ) { const getBlockEditorAction = ( name ) => function* ( ...args ) { deprecated( "`wp.data.dispatch( 'core/editor' )." + name + '`', { + since: '5.3', alternative: "`wp.data.dispatch( 'core/block-editor' )." + name + '`', } ); diff --git a/packages/editor/src/store/selectors.js b/packages/editor/src/store/selectors.js index 9c191e9219aa2c..75ca25a169a81d 100644 --- a/packages/editor/src/store/selectors.js +++ b/packages/editor/src/store/selectors.js @@ -306,6 +306,7 @@ export const getReferenceByDistinctEdits = createRegistrySelector( deprecated( "`wp.data.select( 'core/editor' ).getReferenceByDistinctEdits`", { + since: '5.4', alternative: "`wp.data.select( 'core' ).getReferenceByDistinctEdits`", } @@ -685,9 +686,9 @@ export const isEditedPostAutosaveable = createRegistrySelector( */ export const getAutosave = createRegistrySelector( ( select ) => ( state ) => { deprecated( "`wp.data.select( 'core/editor' ).getAutosave()`", { + since: '5.3', alternative: "`wp.data.select( 'core' ).getAutosave( postType, postId, userId )`", - plugin: 'Gutenberg', } ); const postType = getCurrentPostType( state ); @@ -713,9 +714,9 @@ export const getAutosave = createRegistrySelector( ( select ) => ( state ) => { */ export const hasAutosave = createRegistrySelector( ( select ) => ( state ) => { deprecated( "`wp.data.select( 'core/editor' ).hasAutosave()`", { + since: '5.3', alternative: "`!! wp.data.select( 'core' ).getAutosave( postType, postId, userId )`", - plugin: 'Gutenberg', } ); const postType = getCurrentPostType( state ); @@ -953,7 +954,7 @@ export function getSuggestedPostFormat( state ) { */ export function getBlocksForSerialization( state ) { deprecated( '`core/editor` getBlocksForSerialization selector', { - plugin: 'Gutenberg', + since: '5.3', alternative: 'getEditorBlocks', hint: 'Blocks serialization pre-processing occurs at save time', } ); @@ -1235,6 +1236,8 @@ export function getEditorBlocks( state ) { */ export function getEditorSelectionStart( state ) { deprecated( "select('core/editor').getEditorSelectionStart", { + since: '10.0', + plugin: 'Gutenberg', alternative: "select('core/editor').getEditorSelection", } ); return getEditedPostAttribute( state, 'selection' )?.selectionStart; @@ -1250,6 +1253,8 @@ export function getEditorSelectionStart( state ) { */ export function getEditorSelectionEnd( state ) { deprecated( "select('core/editor').getEditorSelectionStart", { + since: '10.0', + plugin: 'Gutenberg', alternative: "select('core/editor').getEditorSelection", } ); return getEditedPostAttribute( state, 'selection' )?.selectionEnd; @@ -1298,6 +1303,7 @@ export function getEditorSettings( state ) { */ export function getStateBeforeOptimisticTransaction() { deprecated( "select('core/editor').getStateBeforeOptimisticTransaction", { + since: '5.7', hint: 'No state history is kept on this store anymore', } ); @@ -1311,6 +1317,7 @@ export function getStateBeforeOptimisticTransaction() { */ export function inSomeHistory() { deprecated( "select('core/editor').inSomeHistory", { + since: '5.7', hint: 'No state history is kept on this store anymore', } ); return false; @@ -1319,6 +1326,7 @@ export function inSomeHistory() { function getBlockEditorSelector( name ) { return createRegistrySelector( ( select ) => ( state, ...args ) => { deprecated( "`wp.data.select( 'core/editor' )." + name + '`', { + since: '5.3', alternative: "`wp.data.select( 'core/block-editor' )." + name + '`', } ); diff --git a/packages/interface/src/components/action-item/index.js b/packages/interface/src/components/action-item/index.js index 2474b4fd011892..23d3e147eefe3c 100644 --- a/packages/interface/src/components/action-item/index.js +++ b/packages/interface/src/components/action-item/index.js @@ -21,6 +21,8 @@ function ActionItemSlot( { deprecated( 'Passing a tuple of components with `as` prop to `ActionItem.Slot` component', { + since: '10.2', + plugin: 'Gutenberg', alternative: 'a component with `as` prop', version: '10.3', } diff --git a/packages/nux/src/index.js b/packages/nux/src/index.js index ffd4a5e8818828..33f9f766c2b827 100644 --- a/packages/nux/src/index.js +++ b/packages/nux/src/index.js @@ -7,5 +7,6 @@ export { store } from './store'; export { default as DotTip } from './components/dot-tip'; deprecated( 'wp.nux', { + since: '5.4', hint: 'wp.components.Guide can be used to show a user guide.', } ); diff --git a/packages/server-side-render/src/index.js b/packages/server-side-render/src/index.js index cec07d826d1c77..30af329d429a5f 100644 --- a/packages/server-side-render/src/index.js +++ b/packages/server-side-render/src/index.js @@ -43,6 +43,7 @@ const ExportedServerSideRender = withSelect( ( select ) => { if ( window && window.wp && window.wp.components ) { window.wp.components.ServerSideRender = forwardRef( ( props, ref ) => { deprecated( 'wp.components.ServerSideRender', { + since: '5.3', alternative: 'wp.serverSideRender', } ); return ;