admin管理员组文章数量:1335840
In older WordPress versions I have used post_submitbox_misc_actions
. Now with the new Gutenberg editor, I'm struggling to achieve the same functionality with my existing WordPress plugin.
So basically I just need to add a simple checkbox in the "Post & Visibility" section/block in Gutenberg that must not be pre-filled or permanently stored. I just need the information whether the checkbox has been checked or not in the (PHP) WordPress plugin to perform a simple cURL call.
I have managed to add the the checkbox to Gutenberg using an registered JS file and the following code:
function MyPlugin({}) {
return el(
PluginPostStatusInfo,
{
className: 'my-plugin'
},
el(
CheckboxControl,
{
name: 'notify',
label: __( 'Send notification' ),
}
)
);
}
registerPlugin( 'my-plugin', {
render: MyPlugin
} );
But how can I process/read the checkbox information in my (PHP) WordPress plugin?
Thanks for helping!
本文标签: block editorGet value of custom checkbox from Gutenberg sidebar in plugin
版权声明:本文标题:block editor - Get value of custom checkbox from Gutenberg sidebar in plugin 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742388007a2465424.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论