UNPKG

@wordpress/editor

Version:
35 lines (32 loc) 808 B
import { createElement } from "@wordpress/element"; /** * WordPress dependencies */ import { withSelect } from '@wordpress/data'; /** * Internal dependencies */ import PostTypeSupportCheck from '../post-type-support-check'; export function PostLastRevisionCheck({ lastRevisionId, revisionsCount, children }) { if (!lastRevisionId || revisionsCount < 2) { return null; } return createElement(PostTypeSupportCheck, { supportKeys: "revisions" }, children); } export default withSelect(select => { const { getCurrentPostLastRevisionId, getCurrentPostRevisionsCount } = select('core/editor'); return { lastRevisionId: getCurrentPostLastRevisionId(), revisionsCount: getCurrentPostRevisionsCount() }; })(PostLastRevisionCheck); //# sourceMappingURL=check.js.map