-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Editor: Consistently deprecate edit-post and edit-site slots (#61134)
Co-authored-by: youknowriad <[email protected]> Co-authored-by: fabiankaegy <[email protected]>
- Loading branch information
1 parent
ff01bcb
commit bd8c9a7
Showing
7 changed files
with
154 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 0 additions & 28 deletions
28
packages/edit-post/src/components/sidebar/plugin-post-publish-panel/index.js
This file was deleted.
Oops, something went wrong.
32 changes: 0 additions & 32 deletions
32
packages/edit-post/src/components/sidebar/plugin-pre-publish-panel/index.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { | ||
PluginBlockSettingsMenuItem as EditorPluginBlockSettingsMenuItem, | ||
PluginDocumentSettingPanel as EditorPluginDocumentSettingPanel, | ||
PluginMoreMenuItem as EditorPluginMoreMenuItem, | ||
PluginPrePublishPanel as EditorPluginPrePublishPanel, | ||
PluginPostPublishPanel as EditorPluginPostPublishPanel, | ||
PluginPostStatusInfo as EditorPluginPostStatusInfo, | ||
PluginSidebar as EditorPluginSidebar, | ||
PluginSidebarMoreMenuItem as EditorPluginSidebarMoreMenuItem, | ||
} from '@wordpress/editor'; | ||
import deprecated from '@wordpress/deprecated'; | ||
|
||
const deprecateSlot = ( name ) => { | ||
deprecated( `wp.editPost.${ name }`, { | ||
since: '6.6', | ||
alternative: `wp.editor.${ name }`, | ||
} ); | ||
}; | ||
|
||
/* eslint-disable jsdoc/require-param */ | ||
/** | ||
* @see PluginBlockSettingsMenuItem in @wordpress/editor package. | ||
*/ | ||
export function PluginBlockSettingsMenuItem( props ) { | ||
deprecateSlot( 'PluginBlockSettingsMenuItem' ); | ||
return <EditorPluginBlockSettingsMenuItem { ...props } />; | ||
} | ||
|
||
/** | ||
* @see PluginDocumentSettingPanel in @wordpress/editor package. | ||
*/ | ||
export function PluginDocumentSettingPanel( props ) { | ||
deprecateSlot( 'PluginDocumentSettingPanel' ); | ||
return <EditorPluginDocumentSettingPanel { ...props } />; | ||
} | ||
|
||
/** | ||
* @see PluginMoreMenuItem in @wordpress/editor package. | ||
*/ | ||
export function PluginMoreMenuItem( props ) { | ||
deprecateSlot( 'PluginMoreMenuItem' ); | ||
return <EditorPluginMoreMenuItem { ...props } />; | ||
} | ||
|
||
/** | ||
* @see PluginPrePublishPanel in @wordpress/editor package. | ||
*/ | ||
export function PluginPrePublishPanel( props ) { | ||
deprecateSlot( 'PluginPrePublishPanel' ); | ||
return <EditorPluginPrePublishPanel { ...props } />; | ||
} | ||
|
||
/** | ||
* @see PluginPostPublishPanel in @wordpress/editor package. | ||
*/ | ||
export function PluginPostPublishPanel( props ) { | ||
deprecateSlot( 'PluginPostPublishPanel' ); | ||
return <EditorPluginPostPublishPanel { ...props } />; | ||
} | ||
|
||
/** | ||
* @see PluginPostStatusInfo in @wordpress/editor package. | ||
*/ | ||
export function PluginPostStatusInfo( props ) { | ||
deprecateSlot( 'PluginPostStatusInfo' ); | ||
return <EditorPluginPostStatusInfo { ...props } />; | ||
} | ||
|
||
/** | ||
* @see PluginSidebar in @wordpress/editor package. | ||
*/ | ||
export function PluginSidebar( props ) { | ||
deprecateSlot( 'PluginSidebar' ); | ||
return <EditorPluginSidebar { ...props } />; | ||
} | ||
|
||
/** | ||
* @see PluginSidebarMoreMenuItem in @wordpress/editor package. | ||
*/ | ||
export function PluginSidebarMoreMenuItem( props ) { | ||
deprecateSlot( 'PluginSidebarMoreMenuItem' ); | ||
return <EditorPluginSidebarMoreMenuItem { ...props } />; | ||
} | ||
/* eslint-enable jsdoc/require-param */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { | ||
PluginMoreMenuItem as EditorPluginMoreMenuItem, | ||
PluginSidebar as EditorPluginSidebar, | ||
PluginSidebarMoreMenuItem as EditorPluginSidebarMoreMenuItem, | ||
} from '@wordpress/editor'; | ||
import deprecated from '@wordpress/deprecated'; | ||
|
||
const deprecateSlot = ( name ) => { | ||
deprecated( `wp.editPost.${ name }`, { | ||
since: '6.6', | ||
alternative: `wp.editor.${ name }`, | ||
} ); | ||
}; | ||
|
||
/* eslint-disable jsdoc/require-param */ | ||
/** | ||
* @see PluginMoreMenuItem in @wordpress/editor package. | ||
*/ | ||
export function PluginMoreMenuItem( props ) { | ||
deprecateSlot( 'PluginMoreMenuItem' ); | ||
return <EditorPluginMoreMenuItem { ...props } />; | ||
} | ||
|
||
/** | ||
* @see PluginSidebar in @wordpress/editor package. | ||
*/ | ||
export function PluginSidebar( props ) { | ||
deprecateSlot( 'PluginSidebar' ); | ||
return <EditorPluginSidebar { ...props } />; | ||
} | ||
|
||
/** | ||
* @see PluginSidebarMoreMenuItem in @wordpress/editor package. | ||
*/ | ||
export function PluginSidebarMoreMenuItem( props ) { | ||
deprecateSlot( 'PluginSidebarMoreMenuItem' ); | ||
return <EditorPluginSidebarMoreMenuItem { ...props } />; | ||
} | ||
/* eslint-enable jsdoc/require-param */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters