| 1 |
<?php |
| 2 |
|
| 3 |
use ABlocks\Controls\Typography; |
| 4 |
use ABlocks\Controls\Range; |
| 5 |
use ABlocks\Controls\Dimensions; |
| 6 |
use ABlocks\Controls\Border; |
| 7 |
use ABlocks\Controls\BoxShadow; |
| 8 |
use ABlocks\Controls\Alignment; |
| 9 |
|
| 10 |
|
| 11 |
if ( ! defined( 'ABSPATH' ) ) { |
| 12 |
exit; |
| 13 |
} |
| 14 |
|
| 15 |
$attributes = [ |
| 16 |
'block_id' => [ |
| 17 |
'type' => 'string', |
| 18 |
'default' => '', |
| 19 |
], |
| 20 |
'blockVersion' => [ |
| 21 |
'type' => 'number', |
| 22 |
'default' => 2, |
| 23 |
], |
| 24 |
'product_id' => [ |
| 25 |
'type' => 'number', |
| 26 |
'default' => 0, |
| 27 |
], |
| 28 |
'boxColor' => [ |
| 29 |
'type' => 'string', |
| 30 |
'default' => '#515a62', |
| 31 |
], |
| 32 |
'boxColorH' => [ |
| 33 |
'type' => 'string', |
| 34 |
'default' => '#515a62', |
| 35 |
], |
| 36 |
'linkColor' => [ |
| 37 |
'type' => 'string', |
| 38 |
'default' => '#101828', |
| 39 |
], |
| 40 |
'linkColorH' => [ |
| 41 |
'type' => 'string', |
| 42 |
'default' => '#101828', |
| 43 |
], |
| 44 |
'boxBackground' => [ |
| 45 |
'type' => 'string', |
| 46 |
'default' => '#e1f2ff', |
| 47 |
], |
| 48 |
'boxBackgroundH' => [ |
| 49 |
'type' => 'string', |
| 50 |
'default' => '#e1f2ff', |
| 51 |
], |
| 52 |
'isCustom' => [ |
| 53 |
'type' => 'boolean', |
| 54 |
'default' => true, |
| 55 |
], |
| 56 |
]; |
| 57 |
|
| 58 |
$attributes = array_merge( |
| 59 |
$attributes, |
| 60 |
Dimensions::get_attribute( 'infoBoxPadding', true ), |
| 61 |
Typography::get_attribute( 'infoTypography', true ), |
| 62 |
Typography::get_attribute( 'linkTypography', true ), |
| 63 |
BoxShadow::get_attribute( 'infoBoxoxShadow', true ), |
| 64 |
Border::get_attribute( 'infoBoxBorder', true ), |
| 65 |
Alignment::get_attribute( 'infoboxAlignment', true, [ 'value' => 'left' ] ), |
| 66 |
Range::get_attribute( [ |
| 67 |
'attributeName' => 'infoBoxWidth', |
| 68 |
'attributeObjectKey' => 'value', |
| 69 |
'isResponsive' => true, |
| 70 |
'defaultValue' => 100, |
| 71 |
'hasUnit' => true, |
| 72 |
'unitDefaultValue' => '%', |
| 73 |
]), |
| 74 |
); |
| 75 |
|
| 76 |
return array_merge( $attributes, \ABlocks\Classes\BlockGlobal::get_attributes() ); |
| 77 |
|