/
githubmirror
/
gutenberg
Обзор
Документация
Войти
/
githubmirror
/
gutenberg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
routes/guidelines/entity.ts
29 строк
745 B
Marco Ciampini
ESLint: Replace strict config with bulk suppressions (#81248)
07 авг 2026, 14:34
Не верифицирован
07 авг 2026, 14:34
7f43eaf
Код
Авторство
О чём код?
import { dispatch } from '@wordpress/data'; import { store as coreStore } from '@wordpress/core-data'; import { __ } from '@wordpress/i18n'; let registered = false; /** * Registers the read-only guideline scopes registry as a core-data `root` * entity so the Settings page can consume it with `useEntityRecords`, the same * way it consumes post statuses. Idempotent. */ export function registerGuidelineScopeEntity(): void { if ( registered ) { return; } registered = true; dispatch( coreStore ).addEntities( [ { label: __( 'Guideline Scope' ), name: 'guidelineScope', kind: 'root', baseURL: '/wp/v2/knowledge/guideline-scopes', plural: 'guidelineScopes', key: 'slug', supportsPagination: false, }, ] ); }