| @@ -1,7 +1,11 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | namespace ABlocks\Blocks\StarRatings; |
| 3 | 3 | |
| 4 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 5 | + exit; | |
| 6 | +} | |
| 7 | + | |
| 4 | 8 | use ABlocks\Controls\Alignment; |
| 5 | 9 | use ABlocks\Controls\Range; |
| 6 | 10 | use ABlocks\Controls\Typography; |
| 7 | 11 | use ABlocks\Helper; |
| @@ -11,8 +15,12 @@ | ||
| 11 | 15 | 'block_id' => [ |
| 12 | 16 | 'type' => 'string', |
| 13 | 17 | 'default' => '', |
| 14 | 18 | ], |
| 19 | + 'blockVersion' => array( | |
| 20 | + 'type' => 'number', | |
| 21 | + 'default' => '', | |
| 22 | + ), | |
| 15 | 23 | 'scale' => [ |
| 16 | 24 | 'type' => 'number', |
| 17 | 25 | 'default' => 5, |
| 18 | 26 | ], |
| @@ -39,18 +47,17 @@ | ||
| 39 | 47 | 'ratingNumberPosition' => [ |
| 40 | 48 | 'type' => 'string', |
| 41 | 49 | 'default' => 'right', |
| 42 | 50 | ], |
| 51 | + 'rating' => [ | |
| 52 | + 'type' => 'number', | |
| 53 | + 'default' => 4, | |
| 54 | + ], | |
| 43 | 55 | |
| 44 | 56 | ]; |
| 45 | 57 | |
| 46 | 58 | $attributes = array_merge( |
| 47 | 59 | $attributes, |
| 48 | - Range::get_attribute( [ | |
| 49 | - 'attributeName' => 'rating', | |
| 50 | - 'isResponsive' => false, | |
| 51 | - 'defaultValue' => 4, | |
| 52 | - ]), | |
| 53 | 60 | Range::get_attribute( [ |
| 54 | 61 | 'attributeName' => 'size', |
| 55 | 62 | 'attributeObjectKey' => 'value', |
| 56 | 63 | 'isResponsive' => true, |