useBlockAttributes.js
2 years ago
useFields.js
2 years ago
useIsAdvancedValidation.js
2 years ago
useIsUniqueFieldName.js
2 years ago
useSupport.js
2 years ago
useUniqKey.js
2 years ago
useUniqueNameOnDuplicate.js
2 years ago
useIsAdvancedValidation.js
15 lines
| 1 | import useSelectPostMeta from '../../hooks/useSelectPostMeta'; |
| 2 | import useBlockAttributes from './useBlockAttributes'; |
| 3 | |
| 4 | function useIsAdvancedValidation() { |
| 5 | const { type } = useSelectPostMeta( '_jf_validation' ); |
| 6 | const [ attributes ] = useBlockAttributes(); |
| 7 | |
| 8 | if ( attributes.validation?.type ) { |
| 9 | return 'advanced' === attributes.validation?.type; |
| 10 | } |
| 11 | |
| 12 | return 'advanced' === type; |
| 13 | } |
| 14 | |
| 15 | export default useIsAdvancedValidation; |