diff --git a/edit-post/README.md b/edit-post/README.md index fc069f7482c374..fdfac66c203ccf 100644 --- a/edit-post/README.md +++ b/edit-post/README.md @@ -21,6 +21,7 @@ wp.data.dispatch( 'core/edit-post' ).openGeneralSidebar( 'plugin-name/sidebar-na _Example:_ ```jsx +const { __ } = wp.i18n; const { PanelBody } = wp.components; const { PluginSidebar } = wp.editPost; @@ -30,7 +31,7 @@ const MyPluginSidebar = () => ( title="My sidebar title" > - My sidebar content + { __( 'My sidebar content' ) } ); @@ -61,6 +62,7 @@ The text within the component appears as the menu item label. _Example:_ ```jsx +const { __ } = wp.i18n; const { PluginSidebarMoreMenuItem } = wp.editPost; const MySidebarMoreMenuItem = () => ( @@ -68,7 +70,7 @@ const MySidebarMoreMenuItem = () => ( target="my-sidebar" icon="yes" > - My sidebar title + { __( 'My sidebar title' ) } ); ``` @@ -90,3 +92,21 @@ The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug st - Required: No +### `PluginPostStatusInfo` + +Renders a row in the Status & Visibility panel of the Document sidebar. +It should be noted that this is named and implemented around the function it serves and not its location, which may change in future iterations. + +_Example:_ +```jsx +const { __ } = wp.i18n; +const { PluginPostStatusInfo } = wp.editPost; + +const MyPluginPostStatusInfo = () => ( + + { __( 'My post status info' ) } + +); +``` + + diff --git a/edit-post/components/sidebar/plugin-post-status-info/index.js b/edit-post/components/sidebar/plugin-post-status-info/index.js new file mode 100644 index 00000000000000..cbe7efda9f2506 --- /dev/null +++ b/edit-post/components/sidebar/plugin-post-status-info/index.js @@ -0,0 +1,18 @@ +/** + * Defines as extensibility slot for the Status & Visibility panel. + */ + +/** + * WordPress dependencies + */ +import { createSlotFill, PanelRow } from '@wordpress/components'; + +export const { Fill: PluginPostStatusInfo, Slot } = createSlotFill( 'PluginPostStatusInfo' ); + +PluginPostStatusInfo.Slot = () => ( + + + +); + +export default PluginPostStatusInfo; diff --git a/edit-post/components/sidebar/post-status/index.js b/edit-post/components/sidebar/post-status/index.js index 0143013fa0172c..141795d047b221 100644 --- a/edit-post/components/sidebar/post-status/index.js +++ b/edit-post/components/sidebar/post-status/index.js @@ -17,6 +17,7 @@ import PostSticky from '../post-sticky'; import PostAuthor from '../post-author'; import PostFormat from '../post-format'; import PostPendingStatus from '../post-pending-status'; +import PluginPostStatusInfo from '../plugin-post-status-info'; /** * Module Constants @@ -32,6 +33,7 @@ function PostStatus( { isOpened, onTogglePanel } ) { + ); diff --git a/edit-post/index.js b/edit-post/index.js index 8858c482c037ae..2a64d35d9b357b 100644 --- a/edit-post/index.js +++ b/edit-post/index.js @@ -104,5 +104,6 @@ export function initializeEditor( id, post, settings ) { } ); } +export { default as PluginPostStatusInfo } from './components/sidebar/plugin-post-status-info'; export { default as PluginSidebar } from './components/sidebar/plugin-sidebar'; export { default as PluginSidebarMoreMenuItem } from './components/header/plugin-sidebar-more-menu-item';