| 1 |
<?php |
| 2 |
|
| 3 |
if ( ! defined( 'ABSPATH' ) ) { |
| 4 |
exit; |
| 5 |
} |
| 6 |
|
| 7 |
use ABlocks\Controls\Border; |
| 8 |
use ABlocks\Controls\Dimensions; |
| 9 |
use ABlocks\Controls\Typography; |
| 10 |
use ABlocks\Controls\TextShadow; |
| 11 |
use ABlocks\Controls\Alignment; |
| 12 |
use ABlocks\Controls\Link; |
| 13 |
use ABlocks\Helper; |
| 14 |
use ABlocks\Controls\BoxShadow; |
| 15 |
use ABlocks\Controls\Icon; |
| 16 |
use ABlocks\Controls\Range; |
| 17 |
|
| 18 |
$attributes = [ |
| 19 |
'block_id' => [ |
| 20 |
'type' => 'string', |
| 21 |
'default' => '', |
| 22 |
], |
| 23 |
'blockVersion' => array( |
| 24 |
'type' => 'number', |
| 25 |
'default' => '', |
| 26 |
), |
| 27 |
'text' => [ |
| 28 |
'type' => 'string', |
| 29 |
'default' => 'Click here', |
| 30 |
], |
| 31 |
'buttonType' => [ |
| 32 |
'type' => 'string', |
| 33 |
'default' => '#ddd', |
| 34 |
], |
| 35 |
'buttonSize' => [ |
| 36 |
'type' => 'string', |
| 37 |
'default' => 'small', |
| 38 |
], |
| 39 |
'textColor' => [ |
| 40 |
'type' => 'string', |
| 41 |
'default' => '#000000', |
| 42 |
], |
| 43 |
'textColorH' => [ |
| 44 |
'type' => 'string', |
| 45 |
'default' => '', |
| 46 |
], |
| 47 |
'background' => [ |
| 48 |
'type' => 'string', |
| 49 |
'default' => '', |
| 50 |
], |
| 51 |
'backgroundH' => [ |
| 52 |
'type' => 'string', |
| 53 |
'default' => '', |
| 54 |
], |
| 55 |
'transition' => [ |
| 56 |
'type' => 'number', |
| 57 |
'default' => '', |
| 58 |
], |
| 59 |
'showIcon' => [ |
| 60 |
'type' => 'boolean', |
| 61 |
'default' => false, |
| 62 |
], |
| 63 |
'iconPosition' => [ |
| 64 |
'type' => 'string', |
| 65 |
'default' => 'left', |
| 66 |
], |
| 67 |
]; |
| 68 |
|
| 69 |
|
| 70 |
$attributes = array_merge( |
| 71 |
$attributes, |
| 72 |
Icon::get_attribute( 'icon', [ 'size' => '16' ] ), |
| 73 |
Link::get_attribute( 'link' ), |
| 74 |
Border::get_attribute( 'border', true ), |
| 75 |
Dimensions::get_attribute( 'padding', true ), |
| 76 |
Typography::get_attribute( 'typography', true ), |
| 77 |
TextShadow::get_attribute( 'textShadow' ), |
| 78 |
Alignment::get_attribute( 'position', true, [ 'value' => 'left' ] ), |
| 79 |
Alignment::get_attribute( 'alignment', true, [ 'value' => 'left' ] ), |
| 80 |
BoxShadow::get_attribute( 'boxShadow', true ), |
| 81 |
Range::get_attribute([ |
| 82 |
'attributeName' => 'iconSpace', |
| 83 |
'attributeObjectKey' => 'value', |
| 84 |
'isResponsive' => true, |
| 85 |
'defaultValue' => 10, |
| 86 |
'hasUnit' => true, |
| 87 |
'unitDefaultValue' => 'px', |
| 88 |
]), |
| 89 |
); |
| 90 |
|
| 91 |
return array_merge( $attributes, \ABlocks\Classes\BlockGlobal::get_attributes() ); |
| 92 |
|
| 93 |
|