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!