@wordpress/editor
Version:
Enhanced block editor for WordPress posts.
31 lines (29 loc) • 655 B
JavaScript
/**
* External dependencies
*/
import { get } from 'lodash';
/**
* WordPress dependencies
*/
import { compose } from '@wordpress/compose';
import { withSelect } from '@wordpress/data';
export function PostScheduleCheck({
hasPublishAction,
children
}) {
if (!hasPublishAction) {
return null;
}
return children;
}
export default compose([withSelect(select => {
const {
getCurrentPost,
getCurrentPostType
} = select('core/editor');
return {
hasPublishAction: get(getCurrentPost(), ['_links', 'wp:action-publish'], false),
postType: getCurrentPostType()
};
})])(PostScheduleCheck);
//# sourceMappingURL=check.js.map