ChangeNameByLabel.js
2 years ago
ControlsSettings.js
2 years ago
appendField.js
2 years ago
blocksRecursiveIterator.js
2 years ago
getAvailableFields.js
2 years ago
getAvailableFieldsString.js
2 years ago
getBlockControls.js
2 years ago
getBlocksByName.js
2 years ago
getCurrentInnerBlocks.js
2 years ago
getFieldsWithoutCurrent.js
2 years ago
getFormFieldsBlocks.js
2 years ago
getInnerBlocks.js
2 years ago
getBlockControls.js
24 lines
| 1 | import ControlsSettings from './ControlsSettings'; |
| 2 | |
| 3 | function getBlockControls( type = 'all' ) { |
| 4 | if ( !type ) { |
| 5 | return false; |
| 6 | } |
| 7 | const controls = ControlsSettings(); |
| 8 | |
| 9 | if ( 'all' === type ) { |
| 10 | return controls; |
| 11 | } |
| 12 | |
| 13 | if ( controls[ type ] |
| 14 | && controls[ type ].attrs |
| 15 | && Array.isArray( controls[ type ].attrs ) |
| 16 | && 0 < controls[ type ].attrs.length |
| 17 | ) { |
| 18 | return controls[ type ].attrs; |
| 19 | } |
| 20 | |
| 21 | return false; |
| 22 | } |
| 23 | |
| 24 | export default getBlockControls; |