我正在尝试取消注册一些格式类型(corecode,corestrikethrough)。
我尝试了unregisterFormatType函数。它不起作用,控制台说这些类型不存在。
Format core/code is not registered.
这一行看起来像这样。
const {unregisterFormatType} = wp.richText;
unregisterFormatType("core/code");
我到底做错了什么?
我想你必须等到格式被注册后才能取消注册。
所以像这样的东西就可以了。
wp.domReady(function () {
wp.richText.unregisterFormatType('core/code')
})