On Classic Editor and Wordress 4.x i used 'post_submitbox_misc_actions
' action to add custom control to submit box area. Is there a way to do this in Gutenberg editor? Some equivalent to old action?
Thanks for Your help.
On Classic Editor and Wordress 4.x i used 'post_submitbox_misc_actions
' action to add custom control to submit box area. Is there a way to do this in Gutenberg editor? Some equivalent to old action?
Thanks for Your help.
Share Improve this question edited Jan 8, 2019 at 16:35 Jerzy Jerzynka asked Jan 8, 2019 at 14:13 Jerzy JerzynkaJerzy Jerzynka 813 bronze badges1 Answer
Reset to default 4wp_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 = wpponents.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
} );