| @@ -1,5 +1,6 @@ | ||
| 1 | 1 | <?php |
| 2 | +use ABlocks\Controls\Range; | |
| 2 | 3 | |
| 3 | 4 | if ( ! defined( 'ABSPATH' ) ) { |
| 4 | 5 | exit; |
| 5 | 6 | } |
| @@ -10,14 +11,11 @@ | ||
| 10 | 11 | 'default' => '' |
| 11 | 12 | ), |
| 12 | 13 | 'label' => [ |
| 13 | 14 | 'type' => 'string', |
| 14 | - 'default' => '', | |
| 15 | + 'default' => 'Checkbox', | |
| 15 | 16 | ], |
| 16 | - 'inputWidth' => [ | |
| 17 | - 'type' => 'number', | |
| 18 | - 'default' => 100 | |
| 19 | - ], | |
| 17 | + | |
| 20 | 18 | 'errorMsg' => [ |
| 21 | 19 | 'type' => 'string', |
| 22 | 20 | 'default' => 'This field is required', |
| 23 | 21 | ], |
| @@ -48,8 +46,17 @@ | ||
| 48 | 46 | ]; |
| 49 | 47 | |
| 50 | 48 | $attributes = array_merge( |
| 51 | 49 | $attributes, |
| 50 | + Range::get_attribute( [ | |
| 51 | + 'attributeName' => 'inputWidth', | |
| 52 | + 'attributeObjectKey' => 'value', | |
| 53 | + 'isResponsive' => true, | |
| 54 | + 'defaultValue' => 100, | |
| 55 | + 'hasUnit' => true, | |
| 56 | + 'unitDefaultValue' => '%', | |
| 57 | + ] ), | |
| 52 | 58 | ); |
| 59 | + | |
| 53 | 60 | |
| 54 | 61 | return array_merge( $attributes, \ABlocks\Classes\BlockGlobal::get_attributes() ); |
| 55 | 62 | |