PluginProbe
BeyondWords – AI audio for publishers / 4.2.4
BeyondWords – AI audio for publishers v4.2.4
7.1.0 trunk 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.0.5 4.0.6 4.1.0 4.1.1 4.1.2 4.2.0 4.2.1 4.2.2 4.2.3 4.2.4 4.3.0 4.4.0 4.5.0 4.5.1 4.6.0 4.6.1 4.6.2 4.7.0 All 43 releases
speechkit / src / Component / Post / BlockAttributes / check.js

check.js in BeyondWords – AI audio for publishers 4.2.4, at src/Component/Post/BlockAttributes/check.js

27 lines 666 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * WordPress dependencies
3 */
4 import { compose } from '@wordpress/compose';
5 import { withSelect } from '@wordpress/data';
6 import { store as coreStore } from '@wordpress/core-data';
7
8 export function BlockAttributesCheck( { supportsCustomFieldsAction, children } ) {
9 if ( ! supportsCustomFieldsAction ) {
10 return null;
11 }
12
13 return children;
14 }
15
16 export default compose( [
17 withSelect( ( select ) => {
18 const { getCurrentPostType } = select( 'core/editor' );
19 const postType = getCurrentPostType();
20
21 return {
22 supportsCustomFieldsAction:
23 !! select( coreStore ).getPostType( postType )?.supports?.['custom-fields'],
24 };
25 } ),
26 ] )( BlockAttributesCheck );
27