Gutenberg add checkbox using PluginPostStatusInfo

Question

In an attempt to replace the fucntionality of post_submitbox_misc_actions using gutenberg, I have the below…..

import { registerPlugin } from 'wordpress user/plugins';
import { PluginPostStatusInfo } from 'wordpress user/edit-post';
import { CheckboxControl } from 'wordpress user/components';
 
const PluginPostStatusInfoTest = () => (
    <PluginPostStatusInfo>
        <p>Post Status Info SlotFill</p>
    </PluginPostStatusInfo>
);
 
registerPlugin( 'post-status-info-test', { render: PluginPostStatusInfoTest } );

This is working well and is adding PostStatus Info SlotFill text to the correct place in the sidebar. But not I am trying to add a checkbox in that can be saved with the post.

Does anybody have an example they can show me? Can I just add a HTML checkbox or do I need to do it in a more WP native way?

Do I need to do anything different with regards to saving or can I just use the save_post action like with the classic editor?

0
fightstarr20 8 months 2020-11-27T05:10:36-05:00 0 Answers 8 views 0

Leave an answer

Browse
Browse