UNPKG

@wordpress/editor

Version:
45 lines (36 loc) 870 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PostScheduleCheck = PostScheduleCheck; exports.default = void 0; var _lodash = require("lodash"); var _compose = require("@wordpress/compose"); var _data = require("@wordpress/data"); /** * External dependencies */ /** * WordPress dependencies */ function PostScheduleCheck({ hasPublishAction, children }) { if (!hasPublishAction) { return null; } return children; } var _default = (0, _compose.compose)([(0, _data.withSelect)(select => { const { getCurrentPost, getCurrentPostType } = select('core/editor'); return { hasPublishAction: (0, _lodash.get)(getCurrentPost(), ['_links', 'wp:action-publish'], false), postType: getCurrentPostType() }; })])(PostScheduleCheck); exports.default = _default; //# sourceMappingURL=check.js.map