@wordpress/edit-post
Version:
Edit Post module for WordPress.
71 lines (64 loc) • 1.87 kB
JavaScript
import { createElement } from "@wordpress/element";
/**
* Defines as extensibility slot for the Status & Visibility panel.
*/
/**
* WordPress dependencies
*/
import { createSlotFill, PanelRow } from '@wordpress/components';
var _createSlotFill = createSlotFill('PluginPostStatusInfo'),
Fill = _createSlotFill.Fill,
Slot = _createSlotFill.Slot;
/**
* 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.
*
* @param {Object} props Component properties.
* @param {string} [props.className] An optional class name added to the row.
*
* @example <caption>ES5</caption>
* ```js
* // Using ES5 syntax
* var __ = wp.i18n.__;
* var PluginPostStatusInfo = wp.editPost.PluginPostStatusInfo;
*
* function MyPluginPostStatusInfo() {
* return wp.element.createElement(
* PluginPostStatusInfo,
* {
* className: 'my-plugin-post-status-info',
* },
* __( 'My post status info' )
* )
* }
* ```
*
* @example <caption>ESNext</caption>
* ```jsx
* // Using ESNext syntax
* const { __ } = wp.i18n;
* const { PluginPostStatusInfo } = wp.editPost;
*
* const MyPluginPostStatusInfo = () => (
* <PluginPostStatusInfo
* className="my-plugin-post-status-info"
* >
* { __( 'My post status info' ) }
* </PluginPostStatusInfo>
* );
* ```
*
* @return {WPElement} The WPElement to be rendered.
*/
export { Fill, Slot };
var PluginPostStatusInfo = function PluginPostStatusInfo(_ref) {
var children = _ref.children,
className = _ref.className;
return createElement(Fill, null, createElement(PanelRow, {
className: className
}, children));
};
PluginPostStatusInfo.Slot = Slot;
export default PluginPostStatusInfo;
//# sourceMappingURL=index.js.map