/
githubmirror
/
gutenberg
Обзор
Документация
Войти
/
githubmirror
/
gutenberg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
packages/block-directory/src/plugins/index.js
34 строки
981 B
Marco Ciampini
ESLint: Replace strict config with bulk suppressions (#81248)
07 авг 2026, 14:34
Не верифицирован
07 авг 2026, 14:34
7f43eaf
Код
Авторство
О чём код?
import { registerPlugin } from '@wordpress/plugins'; import { addFilter } from '@wordpress/hooks'; import AutoBlockUninstaller from '../components/auto-block-uninstaller'; import InserterMenuDownloadableBlocksPanel from './inserter-menu-downloadable-blocks-panel'; import InstalledBlocksPrePublishPanel from './installed-blocks-pre-publish-panel'; import getInstallMissing from './get-install-missing'; registerPlugin( 'block-directory', { // The icon is explicitly set to undefined to prevent PluginPrePublishPanel // from rendering the fallback icon pluginIcon. icon: undefined, render() { return ( <> <AutoBlockUninstaller /> <InserterMenuDownloadableBlocksPanel /> <InstalledBlocksPrePublishPanel /> </> ); }, } ); addFilter( 'blocks.registerBlockType', 'block-directory/fallback', ( settings, name ) => { if ( name !== 'core/missing' ) { return settings; } settings.edit = getInstallMissing( settings.edit ); return settings; } );