UNPKG

@wordpress/editor

Version:
25 lines (21 loc) 565 B
/** * WordPress dependencies */ import { withSelect } from '@wordpress/data'; /** * Internal dependencies */ import PostTypeSupportCheck from '../post-type-support-check'; function PostFormatCheck( { disablePostFormats, ...props } ) { return ( ! disablePostFormats && ( <PostTypeSupportCheck { ...props } supportKeys="post-formats" /> ) ); } export default withSelect( ( select ) => { const editorSettings = select( 'core/editor' ).getEditorSettings(); return { disablePostFormats: editorSettings.disablePostFormats, }; } )( PostFormatCheck );