| @@ -1,0 +1,58 @@ | ||
| 1 | +<?php | |
| 2 | +use ABlocks\Controls\Range; | |
| 3 | + | |
| 4 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 5 | + exit; | |
| 6 | +} | |
| 7 | + | |
| 8 | +$attributes = [ | |
| 9 | + 'block_id' => array( | |
| 10 | + 'type' => 'string', | |
| 11 | + 'default' => '' | |
| 12 | + ), | |
| 13 | + | |
| 14 | + 'label' => [ | |
| 15 | + 'type' => 'string', | |
| 16 | + 'default' => 'What\'s your favorite programming lang?' | |
| 17 | + ], | |
| 18 | + 'name' => [ | |
| 19 | + 'type' => 'string', | |
| 20 | + 'default' => '', | |
| 21 | + ], | |
| 22 | + 'helperText' => [ | |
| 23 | + 'type' => 'string', | |
| 24 | + 'default' => '' | |
| 25 | + ], | |
| 26 | + 'isRequired' => [ | |
| 27 | + 'type' => 'boolean', | |
| 28 | + 'default' => true, | |
| 29 | + ], | |
| 30 | + 'errorMsg' => [ | |
| 31 | + 'type' => 'string', | |
| 32 | + 'default' => 'This field is required', | |
| 33 | + ], | |
| 34 | + 'options' => [ | |
| 35 | + 'type' => 'array', | |
| 36 | + 'default' => [ | |
| 37 | + [ | |
| 38 | + 'id' => 1, | |
| 39 | + 'value' => 'javascript' | |
| 40 | + ] | |
| 41 | + ] | |
| 42 | + ] | |
| 43 | +]; | |
| 44 | + | |
| 45 | +$attributes = array_merge( | |
| 46 | + $attributes, | |
| 47 | + Range::get_attribute( [ | |
| 48 | + 'attributeName' => 'inputWidth', | |
| 49 | + 'attributeObjectKey' => 'value', | |
| 50 | + 'isResponsive' => true, | |
| 51 | + 'defaultValue' => 100, | |
| 52 | + 'hasUnit' => true, | |
| 53 | + 'unitDefaultValue' => '%', | |
| 54 | + ] ), | |
| 55 | +); | |
| 56 | + | |
| 57 | +return array_merge( $attributes, \ABlocks\Classes\BlockGlobal::get_attributes() ); | |
| 58 | + | |