wp_enqueue_script(
\'some-slug\',
\'/path/to/script.js\',
array( \'wp-edit-post\', \'wp-plugins\', \'wp-i18n\', \'wp-element\' ),
\'0.1\'
);
script.js
:
var el = wp.element.createElement;
var __ = wp.i18n.__;
var registerPlugin = wp.plugins.registerPlugin;
var PluginPostStatusInfo = wp.editPost.PluginPostStatusInfo;
var TextControl = wp.components.TextControl;
function MyPostStatusInfoPlugin({}) {
return el(
PluginPostStatusInfo,
{
className: \'my-post-status-info\'
},
el(
TextControl,
{
name: \'my_edit_summary\',
label: __( \'Edit summary\' ),
help: __( \'Briefly summarise your changes\' )
}
)
);
}
registerPlugin( \'my-post-status-info-plugin\', {
render: MyPostStatusInfoPlugin
} );