| @@ -2,9 +2,8 @@ | ||
| 2 | 2 | |
| 3 | 3 | namespace Elementor\Core\Kits\Documents\Tabs; |
| 4 | 4 | |
| 5 | 5 | use Elementor\Controls_Manager; |
| 6 | -use Elementor\Group_Control_Background; | |
| 7 | 6 | use Elementor\Group_Control_Border; |
| 8 | 7 | use Elementor\Group_Control_Box_Shadow; |
| 9 | 8 | use Elementor\Group_Control_Text_Shadow; |
| 10 | 9 | use Elementor\Group_Control_Typography; |
| @@ -9,9 +8,9 @@ | ||
| 9 | 8 | use Elementor\Group_Control_Text_Shadow; |
| 10 | 9 | use Elementor\Group_Control_Typography; |
| 11 | 10 | |
| 12 | 11 | if ( ! defined( 'ABSPATH' ) ) { |
| 13 | - exit; // Exit if accessed directly. | |
| 12 | + exit; // Exit if accessed directly | |
| 14 | 13 | } |
| 15 | 14 | |
| 16 | 15 | class Theme_Style_Buttons extends Tab_Base { |
| 17 | 16 | |
| @@ -19,9 +18,9 @@ | ||
| 19 | 18 | return 'theme-style-buttons'; |
| 20 | 19 | } |
| 21 | 20 | |
| 22 | 21 | public function get_title() { |
| 23 | - return esc_html__( 'Buttons', 'elementor' ); | |
| 22 | + return __( 'Buttons', 'elementor' ); | |
| 24 | 23 | } |
| 25 | 24 | |
| 26 | 25 | public function get_group() { |
| 27 | 26 | return 'theme-style'; |
| @@ -31,9 +30,9 @@ | ||
| 31 | 30 | return 'eicon-button'; |
| 32 | 31 | } |
| 33 | 32 | |
| 34 | 33 | public function get_help_url() { |
| 35 | - return 'https://go.elementor.com/global-theme-style-buttons/'; | |
| 34 | + return 'https://go.elementor.com/global-theme-style-buttons'; | |
| 36 | 35 | } |
| 37 | 36 | |
| 38 | 37 | protected function register_tab_controls() { |
| 39 | 38 | $button_selectors = [ |
| @@ -59,9 +58,9 @@ | ||
| 59 | 58 | |
| 60 | 59 | $this->start_controls_section( |
| 61 | 60 | 'section_buttons', |
| 62 | 61 | [ |
| 63 | - 'label' => esc_html__( 'Buttons', 'elementor' ), | |
| 62 | + 'label' => __( 'Buttons', 'elementor' ), | |
| 64 | 63 | 'tab' => $this->get_id(), |
| 65 | 64 | ] |
| 66 | 65 | ); |
| 67 | 66 | |
| @@ -69,8 +68,9 @@ | ||
| 69 | 68 | |
| 70 | 69 | $this->add_group_control( |
| 71 | 70 | Group_Control_Typography::get_type(), |
| 72 | 71 | [ |
| 72 | + 'label' => __( 'Typography', 'elementor' ), | |
| 73 | 73 | 'name' => 'button_typography', |
| 74 | 74 | 'selector' => $button_selector, |
| 75 | 75 | ] |
| 76 | 76 | ); |
| @@ -87,9 +87,9 @@ | ||
| 87 | 87 | |
| 88 | 88 | $this->start_controls_tab( |
| 89 | 89 | 'tab_button_normal', |
| 90 | 90 | [ |
| 91 | - 'label' => esc_html__( 'Normal', 'elementor' ), | |
| 91 | + 'label' => __( 'Normal', 'elementor' ), | |
| 92 | 92 | ] |
| 93 | 93 | ); |
| 94 | 94 | |
| 95 | 95 | $this->add_control( |
| @@ -94,9 +94,9 @@ | ||
| 94 | 94 | |
| 95 | 95 | $this->add_control( |
| 96 | 96 | 'button_text_color', |
| 97 | 97 | [ |
| 98 | - 'label' => esc_html__( 'Text Color', 'elementor' ), | |
| 98 | + 'label' => __( 'Text Color', 'elementor' ), | |
| 99 | 99 | 'type' => Controls_Manager::COLOR, |
| 100 | 100 | 'dynamic' => [], |
| 101 | 101 | 'selectors' => [ |
| 102 | 102 | $button_selector => 'color: {{VALUE}};', |
| @@ -103,25 +103,16 @@ | ||
| 103 | 103 | ], |
| 104 | 104 | ] |
| 105 | 105 | ); |
| 106 | 106 | |
| 107 | - $this->add_group_control( | |
| 108 | - Group_Control_Background::get_type(), | |
| 107 | + $this->add_control( | |
| 108 | + 'button_background_color', | |
| 109 | 109 | [ |
| 110 | - 'name' => 'button_background', | |
| 111 | - 'types' => [ 'classic', 'gradient' ], | |
| 112 | - 'exclude' => [ 'image' ], | |
| 113 | - 'selector' => $button_selector, | |
| 114 | - 'fields_options' => [ | |
| 115 | - 'background' => [ | |
| 116 | - 'default' => 'classic', | |
| 117 | - ], | |
| 118 | - 'color' => [ | |
| 119 | - 'dynamic' => [], | |
| 120 | - ], | |
| 121 | - 'color_b' => [ | |
| 122 | - 'dynamic' => [], | |
| 123 | - ], | |
| 110 | + 'label' => __( 'Background Color', 'elementor' ), | |
| 111 | + 'type' => Controls_Manager::COLOR, | |
| 112 | + 'dynamic' => [], | |
| 113 | + 'selectors' => [ | |
| 114 | + $button_selector => 'background-color: {{VALUE}};', | |
| 124 | 115 | ], |
| 125 | 116 | ] |
| 126 | 117 | ); |
| 127 | 118 | |
| @@ -148,11 +139,11 @@ | ||
| 148 | 139 | |
| 149 | 140 | $this->add_control( |
| 150 | 141 | 'button_border_radius', |
| 151 | 142 | [ |
| 152 | - 'label' => esc_html__( 'Border Radius', 'elementor' ), | |
| 143 | + 'label' => __( 'Border Radius', 'elementor' ), | |
| 153 | 144 | 'type' => Controls_Manager::DIMENSIONS, |
| 154 | - 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], | |
| 145 | + 'size_units' => [ 'px', '%' ], | |
| 155 | 146 | 'selectors' => [ |
| 156 | 147 | $button_selector => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 157 | 148 | ], |
| 158 | 149 | ] |
| @@ -162,9 +153,9 @@ | ||
| 162 | 153 | |
| 163 | 154 | $this->start_controls_tab( |
| 164 | 155 | 'tab_button_hover', |
| 165 | 156 | [ |
| 166 | - 'label' => esc_html__( 'Hover', 'elementor' ), | |
| 157 | + 'label' => __( 'Hover', 'elementor' ), | |
| 167 | 158 | ] |
| 168 | 159 | ); |
| 169 | 160 | |
| 170 | 161 | $this->add_control( |
| @@ -169,9 +160,9 @@ | ||
| 169 | 160 | |
| 170 | 161 | $this->add_control( |
| 171 | 162 | 'button_hover_text_color', |
| 172 | 163 | [ |
| 173 | - 'label' => esc_html__( 'Text Color', 'elementor' ), | |
| 164 | + 'label' => __( 'Text Color', 'elementor' ), | |
| 174 | 165 | 'type' => Controls_Manager::COLOR, |
| 175 | 166 | 'dynamic' => [], |
| 176 | 167 | 'selectors' => [ |
| 177 | 168 | $button_hover_selector => 'color: {{VALUE}};', |
| @@ -178,25 +169,16 @@ | ||
| 178 | 169 | ], |
| 179 | 170 | ] |
| 180 | 171 | ); |
| 181 | 172 | |
| 182 | - $this->add_group_control( | |
| 183 | - Group_Control_Background::get_type(), | |
| 173 | + $this->add_control( | |
| 174 | + 'button_hover_background_color', | |
| 184 | 175 | [ |
| 185 | - 'name' => 'button_hover_background', | |
| 186 | - 'types' => [ 'classic', 'gradient' ], | |
| 187 | - 'exclude' => [ 'image' ], | |
| 188 | - 'selector' => $button_hover_selector, | |
| 189 | - 'fields_options' => [ | |
| 190 | - 'background' => [ | |
| 191 | - 'default' => 'classic', | |
| 192 | - ], | |
| 193 | - 'color' => [ | |
| 194 | - 'dynamic' => [], | |
| 195 | - ], | |
| 196 | - 'color_b' => [ | |
| 197 | - 'dynamic' => [], | |
| 198 | - ], | |
| 176 | + 'label' => __( 'Background Color', 'elementor' ), | |
| 177 | + 'type' => Controls_Manager::COLOR, | |
| 178 | + 'dynamic' => [], | |
| 179 | + 'selectors' => [ | |
| 180 | + $button_hover_selector => 'background-color: {{VALUE}};', | |
| 199 | 181 | ], |
| 200 | 182 | ] |
| 201 | 183 | ); |
| 202 | 184 | |
| @@ -223,11 +205,11 @@ | ||
| 223 | 205 | |
| 224 | 206 | $this->add_control( |
| 225 | 207 | 'button_hover_border_radius', |
| 226 | 208 | [ |
| 227 | - 'label' => esc_html__( 'Border Radius', 'elementor' ), | |
| 209 | + 'label' => __( 'Border Radius', 'elementor' ), | |
| 228 | 210 | 'type' => Controls_Manager::DIMENSIONS, |
| 229 | - 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], | |
| 211 | + 'size_units' => [ 'px', '%' ], | |
| 230 | 212 | 'selectors' => [ |
| 231 | 213 | $button_hover_selector => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 232 | 214 | ], |
| 233 | 215 | ] |
| @@ -239,11 +221,11 @@ | ||
| 239 | 221 | |
| 240 | 222 | $this->add_responsive_control( |
| 241 | 223 | 'button_padding', |
| 242 | 224 | [ |
| 243 | - 'label' => esc_html__( 'Padding', 'elementor' ), | |
| 225 | + 'label' => __( 'Padding', 'elementor' ), | |
| 244 | 226 | 'type' => Controls_Manager::DIMENSIONS, |
| 245 | - 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], | |
| 227 | + 'size_units' => [ 'px', 'em', '%' ], | |
| 246 | 228 | 'selectors' => [ |
| 247 | 229 | $button_selector => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 248 | 230 | ], |
| 249 | 231 | 'separator' => 'before', |