本文介绍了如何在“文档"下添加新面板在古腾堡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试在文档选项卡下添加一个新的组件面板,例如类别、特色图片等.
I am trying to add a new component panel under document tab, like categories, featured image etc.
推荐答案
他们添加了 PluginDocumentSettingPanel SlotFill 现在.
They've added the PluginDocumentSettingPanel SlotFill now.
const { registerPlugin } = wp.plugins
const { PluginDocumentSettingPanel } = wp.editPost
const PluginDocumentSettingPanelDemo = () => (
<PluginDocumentSettingPanel
name="custom-panel"
title="Custom Panel"
className="custom-panel"
>
Custom Panel Contents
</PluginDocumentSettingPanel>
)
registerPlugin('plugin-document-setting-panel-demo', {
render: PluginDocumentSettingPanelDemo
})
这篇关于如何在“文档"下添加新面板在古腾堡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!