/
githubmirror
/
wp-calypso
Обзор
Документация
Войти
/
githubmirror
/
wp-calypso
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
apps/wpcom-block-editor/src/wpcom/utils.ts
24 строки
888 B
arthur791004
wpcom-block-editor: Support getting the canvas mode from the query string after GB 19.6 (#95979)
01 ноя 2024, 11:59
Не верифицирован
01 ноя 2024, 11:59
3427a68
Код
Авторство
О чём код?
import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis'; /** * Get unlock API from Gutenberg. * Sometimes Gutenberg doesn't allow you to re-register the module and throws an error. */ export const getUnlock = () => { /** * Sometimes Gutenberg doesn't allow you to re-register the module and throws an error. */ // eslint-disable-next-line @typescript-eslint/no-explicit-any let unlock: ( object: any ) => any | undefined; try { unlock = __dangerousOptInToUnstableAPIsOnlyForCoreModules( 'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/edit-site' ).unlock; return unlock; } catch ( error ) { // eslint-disable-next-line no-console console.error( 'Error: Unable to get the unlock api. Reason: %s', error ); return undefined; } };