| 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 |
use ABlocks\Components\ButtonGroup; |
| 10 |
|
| 11 |
|
| 12 |
if ( ! defined( 'ABSPATH' ) ) { |
| 13 |
exit; |
| 14 |
} |
| 15 |
|
| 16 |
$attributes = [ |
| 17 |
'block_id' => [ |
| 18 |
'type' => 'string', |
| 19 |
'default' => '', |
| 20 |
], |
| 21 |
'blockVersion' => [ |
| 22 |
'type' => 'number', |
| 23 |
'default' => 2, |
| 24 |
], |
| 25 |
'transition' => [ |
| 26 |
'type' => 'number', |
| 27 |
'default' => 10, |
| 28 |
], |
| 29 |
'showTitle' => [ |
| 30 |
'type' => 'boolean', |
| 31 |
'default' => true, |
| 32 |
], |
| 33 |
'fillColor' => [ |
| 34 |
'type' => 'string', |
| 35 |
'default' => '', |
| 36 |
], |
| 37 |
'iconColor' => [ |
| 38 |
'type' => 'string', |
| 39 |
'default' => '', |
| 40 |
], |
| 41 |
'titleColor' => [ |
| 42 |
'type' => 'string', |
| 43 |
'default' => '', |
| 44 |
], |
| 45 |
'bgColor' => [ |
| 46 |
'type' => 'string', |
| 47 |
'default' => '', |
| 48 |
], |
| 49 |
'activeFillColor' => [ |
| 50 |
'type' => 'string', |
| 51 |
'default' => '', |
| 52 |
], |
| 53 |
'activeIconColor' => [ |
| 54 |
'type' => 'string', |
| 55 |
'default' => '', |
| 56 |
], |
| 57 |
'activeTitleColor' => [ |
| 58 |
'type' => 'string', |
| 59 |
'default' => '', |
| 60 |
], |
| 61 |
'activeBGColor' => [ |
| 62 |
'type' => 'string', |
| 63 |
'default' => '', |
| 64 |
], |
| 65 |
|
| 66 |
'post_id' => [ |
| 67 |
'type' => 'number', |
| 68 |
], |
| 69 |
'show_label' => [ |
| 70 |
'type' => 'boolean', |
| 71 |
'default' => true, |
| 72 |
], |
| 73 |
'show_icon' => [ |
| 74 |
'type' => 'boolean', |
| 75 |
'default' => true, |
| 76 |
], |
| 77 |
'label_single' => [ |
| 78 |
'type' => 'string', |
| 79 |
'default' => 'upvote', |
| 80 |
], |
| 81 |
'label_plural' => [ |
| 82 |
'type' => 'string', |
| 83 |
'default' => 'upvotes', |
| 84 |
], |
| 85 |
'wrapper_class' => [ |
| 86 |
'type' => 'string', |
| 87 |
'default' => 'upvote-count-wrapper', |
| 88 |
], |
| 89 |
'upvoteNumberColor' => [ |
| 90 |
'type' => 'string', |
| 91 |
'default' => '', |
| 92 |
], |
| 93 |
]; |
| 94 |
|
| 95 |
$attributes = array_merge( |
| 96 |
ButtonGroup::get_attribute( 'justificationAlign', true, [ |
| 97 |
'value' => 'center', |
| 98 |
] ), |
| 99 |
Border::get_attribute( 'border', true ), |
| 100 |
Border::get_attribute( 'activeBorder', true ), |
| 101 |
Typography::get_attribute( 'titleTypography', true ), |
| 102 |
Typography::get_attribute( 'activeTitleTypography', true ), |
| 103 |
Dimensions::get_attribute( 'padding', true ), |
| 104 |
Range::get_attribute( [ |
| 105 |
'attributeName' => 'iconSize', |
| 106 |
'attributeObjectKey' => 'value', |
| 107 |
'isResponsive' => true, |
| 108 |
'defaultValue' => 20, |
| 109 |
'hasUnit' => true, |
| 110 |
'unitDefaultValue' => 'px', |
| 111 |
] ), |
| 112 |
Range::get_attribute( [ |
| 113 |
'attributeName' => 'itemGap', |
| 114 |
'attributeObjectKey' => 'value', |
| 115 |
'isResponsive' => true, |
| 116 |
'defaultValue' => 20, |
| 117 |
'hasUnit' => true, |
| 118 |
'unitDefaultValue' => 'px', |
| 119 |
] ), |
| 120 |
$attributes, |
| 121 |
Alignment::get_attribute( 'countAlignment', true, [ 'value' => 'left' ] ), |
| 122 |
); |
| 123 |
|
| 124 |
return array_merge( $attributes, \ABlocks\Classes\BlockGlobal::get_attributes() ); |
| 125 |
|
| 126 |
|