| @@ -1,5 +1,6 @@ | ||
| 1 | 1 | <?php |
| 2 | +use ABlocks\Controls\Range; | |
| 2 | 3 | |
| 3 | 4 | if ( ! defined( 'ABSPATH' ) ) { |
| 4 | 5 | exit; |
| 5 | 6 | } |
| @@ -8,13 +9,10 @@ | ||
| 8 | 9 | 'block_id' => array( |
| 9 | 10 | 'type' => 'string', |
| 10 | 11 | 'default' => '' |
| 11 | 12 | ), |
| 12 | - 'inputWidth' => [ | |
| 13 | - 'type' => 'number', | |
| 14 | - 'default' => 100 | |
| 15 | - ], | |
| 16 | - 'labelName' => [ | |
| 13 | + | |
| 14 | + 'label' => [ | |
| 17 | 15 | 'type' => 'string', |
| 18 | 16 | 'default' => 'What\'s your favorite programming lang?' |
| 19 | 17 | ], |
| 20 | 18 | 'name' => [ |
| @@ -45,8 +43,16 @@ | ||
| 45 | 43 | ]; |
| 46 | 44 | |
| 47 | 45 | $attributes = array_merge( |
| 48 | 46 | $attributes, |
| 47 | + Range::get_attribute( [ | |
| 48 | + 'attributeName' => 'inputWidth', | |
| 49 | + 'attributeObjectKey' => 'value', | |
| 50 | + 'isResponsive' => true, | |
| 51 | + 'defaultValue' => 100, | |
| 52 | + 'hasUnit' => true, | |
| 53 | + 'unitDefaultValue' => '%', | |
| 54 | + ] ), | |
| 49 | 55 | ); |
| 50 | 56 | |
| 51 | 57 | return array_merge( $attributes, \ABlocks\Classes\BlockGlobal::get_attributes() ); |
| 52 | 58 | |