Get value of custom checkbox from Gutenberg sidebar in plugin


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(
            className: 'my-plugin'
                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!

, Daniel 3 years 2020-05-30T06:10:19-05:00 0 Answers 96 views 0

Leave an answer