| 1 |
<?php |
| 2 |
|
| 3 |
if ( ! defined( 'ABSPATH' ) ) { |
| 4 |
exit; |
| 5 |
} |
| 6 |
|
| 7 |
use ABlocks\Controls\Alignment; |
| 8 |
use ABlocks\Controls\Icon; |
| 9 |
use ABlocks\Controls\Range; |
| 10 |
use ABlocks\Controls\Typography; |
| 11 |
use ABlocks\Controls\TextShadow; |
| 12 |
use ABlocks\Controls\Dimensions; |
| 13 |
use ABlocks\Controls\Border; |
| 14 |
|
| 15 |
$attributes = [ |
| 16 |
'block_id' => [ |
| 17 |
'type' => 'string', |
| 18 |
'default' => '' |
| 19 |
], |
| 20 |
'blockVersion' => array( |
| 21 |
'type' => 'number', |
| 22 |
'default' => '', |
| 23 |
), |
| 24 |
'couponStyle' => [ |
| 25 |
'type' => 'string', |
| 26 |
'default' => 'default' |
| 27 |
], |
| 28 |
'couponCode' => [ |
| 29 |
'type' => 'string', |
| 30 |
'default' => 'KODEZEN50' |
| 31 |
], |
| 32 |
'couponBtnText' => [ |
| 33 |
'type' => 'string', |
| 34 |
'default' => 'Copy Code' |
| 35 |
], |
| 36 |
'couponBtnAfterCopyText' => [ |
| 37 |
'type' => 'string', |
| 38 |
'default' => 'Copied!' |
| 39 |
], |
| 40 |
|
| 41 |
'couponCodeColor' => [ |
| 42 |
'type' => 'string', |
| 43 |
'default' => '#000000', |
| 44 |
], |
| 45 |
'couponCodeBgColor' => [ |
| 46 |
'type' => 'string', |
| 47 |
'default' => '#ffffff', |
| 48 |
], |
| 49 |
'couponBtnTextColor' => [ |
| 50 |
'type' => 'string', |
| 51 |
'default' => '#ffffff', |
| 52 |
], |
| 53 |
'couponBtnBgColor' => [ |
| 54 |
'type' => 'string', |
| 55 |
'default' => '#000000', |
| 56 |
], |
| 57 |
|
| 58 |
'isShowIcon' => [ |
| 59 |
'type' => 'boolean', |
| 60 |
'default' => true, |
| 61 |
], |
| 62 |
]; |
| 63 |
|
| 64 |
|
| 65 |
$attributes = array_merge( |
| 66 |
Range::get_attribute( [ |
| 67 |
'attributeName' => 'iconSize', |
| 68 |
'isResponsive' => true, |
| 69 |
'attributeObjectKey' => 'value', |
| 70 |
'defaultValue' => 20, |
| 71 |
]), |
| 72 |
Range::get_attribute( [ |
| 73 |
'attributeName' => 'iconRotate', |
| 74 |
'isResponsive' => false, |
| 75 |
'defaultValue' => 0, |
| 76 |
]), |
| 77 |
Icon::get_attribute( 'icon', [ 'size' => '20' ] ), |
| 78 |
Alignment::get_attribute( 'position', true, [ 'value' => 'left' ] ), |
| 79 |
Typography::get_attribute( 'couponTypography', true ), |
| 80 |
TextShadow::get_attribute( 'couponTextShadow' ), |
| 81 |
Typography::get_attribute( 'buttonTypography', true ), |
| 82 |
TextShadow::get_attribute( 'buttonTextShadow' ), |
| 83 |
Dimensions::get_attribute( 'couponPadding', true ), |
| 84 |
Dimensions::get_attribute( 'buttonPadding', true ), |
| 85 |
Border::get_attribute( 'couponBorder', true ), |
| 86 |
Border::get_attribute( 'buttonBorder', true ), |
| 87 |
$attributes |
| 88 |
); |
| 89 |
|
| 90 |
return array_merge( $attributes, \ABlocks\Classes\BlockGlobal::get_attributes() ); |
| 91 |
|
| 92 |
|