/
githubmirror
/
gutenberg
Обзор
Документация
Войти
/
githubmirror
/
gutenberg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
packages/edit-site/src/deprecated.js
53 строки
1 KB
Marco Ciampini
ESLint: Replace strict config with bulk suppressions (#81248)
07 авг 2026, 14:34
Не верифицирован
07 авг 2026, 14:34
7f43eaf
Код
Авторство
О чём код?
import { PluginMoreMenuItem as EditorPluginMoreMenuItem, PluginSidebar as EditorPluginSidebar, PluginSidebarMoreMenuItem as EditorPluginSidebarMoreMenuItem, } from '@wordpress/editor'; import { getPath } from '@wordpress/url'; import deprecated from '@wordpress/deprecated'; const isSiteEditor = getPath( window.location.href )?.includes( 'site-editor.php' ); 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 ) { if ( ! isSiteEditor ) { return null; } deprecateSlot( 'PluginMoreMenuItem' ); return <EditorPluginMoreMenuItem { ...props } />; } /** * @see PluginSidebar in @wordpress/editor package. */ export function PluginSidebar( props ) { if ( ! isSiteEditor ) { return null; } deprecateSlot( 'PluginSidebar' ); return <EditorPluginSidebar { ...props } />; } /** * @see PluginSidebarMoreMenuItem in @wordpress/editor package. */ export function PluginSidebarMoreMenuItem( props ) { if ( ! isSiteEditor ) { return null; } deprecateSlot( 'PluginSidebarMoreMenuItem' ); return <EditorPluginSidebarMoreMenuItem { ...props } />; } /* eslint-enable jsdoc/require-param */