| @@ -41,9 +41,9 @@ | ||
| 41 | 41 | * |
| 42 | 42 | * @return string Widget title. |
| 43 | 43 | */ |
| 44 | 44 | public function get_title() { |
| 45 | - return esc_html__( 'Icon List', 'elementor' ); | |
| 45 | + return __( 'Icon List', 'elementor' ); | |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | /** |
| 49 | 49 | * Get widget icon. |
| @@ -72,43 +72,21 @@ | ||
| 72 | 72 | public function get_keywords() { |
| 73 | 73 | return [ 'icon list', 'icon', 'list' ]; |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - protected function is_dynamic_content(): bool { | |
| 77 | - return false; | |
| 78 | - } | |
| 79 | - | |
| 80 | - public function has_widget_inner_wrapper(): bool { | |
| 81 | - return ! Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' ); | |
| 82 | - } | |
| 83 | - | |
| 84 | 76 | /** |
| 85 | - * Get style dependencies. | |
| 86 | - * | |
| 87 | - * Retrieve the list of style dependencies the widget requires. | |
| 88 | - * | |
| 89 | - * @since 3.24.0 | |
| 90 | - * @access public | |
| 91 | - * | |
| 92 | - * @return array Widget style dependencies. | |
| 93 | - */ | |
| 94 | - public function get_style_depends(): array { | |
| 95 | - return [ 'widget-icon-list' ]; | |
| 96 | - } | |
| 97 | - | |
| 98 | - /** | |
| 99 | 77 | * Register icon list widget controls. |
| 100 | 78 | * |
| 101 | 79 | * Adds different input fields to allow the user to change and customize the widget settings. |
| 102 | 80 | * |
| 103 | - * @since 3.1.0 | |
| 81 | + * @since 1.0.0 | |
| 104 | 82 | * @access protected |
| 105 | 83 | */ |
| 106 | - protected function register_controls() { | |
| 84 | + protected function _register_controls() { | |
| 107 | 85 | $this->start_controls_section( |
| 108 | 86 | 'section_icon', |
| 109 | 87 | [ |
| 110 | - 'label' => esc_html__( 'Icon List', 'elementor' ), | |
| 88 | + 'label' => __( 'Icon List', 'elementor' ), | |
| 111 | 89 | ] |
| 112 | 90 | ); |
| 113 | 91 | |
| 114 | 92 | $this->add_control( |
| @@ -113,18 +91,18 @@ | ||
| 113 | 91 | |
| 114 | 92 | $this->add_control( |
| 115 | 93 | 'view', |
| 116 | 94 | [ |
| 117 | - 'label' => esc_html__( 'Layout', 'elementor' ), | |
| 95 | + 'label' => __( 'Layout', 'elementor' ), | |
| 118 | 96 | 'type' => Controls_Manager::CHOOSE, |
| 119 | 97 | 'default' => 'traditional', |
| 120 | 98 | 'options' => [ |
| 121 | 99 | 'traditional' => [ |
| 122 | - 'title' => esc_html__( 'Default', 'elementor' ), | |
| 100 | + 'title' => __( 'Default', 'elementor' ), | |
| 123 | 101 | 'icon' => 'eicon-editor-list-ul', |
| 124 | 102 | ], |
| 125 | 103 | 'inline' => [ |
| 126 | - 'title' => esc_html__( 'Inline', 'elementor' ), | |
| 104 | + 'title' => __( 'Inline', 'elementor' ), | |
| 127 | 105 | 'icon' => 'eicon-ellipsis-h', |
| 128 | 106 | ], |
| 129 | 107 | ], |
| 130 | 108 | 'render_type' => 'template', |
| @@ -138,13 +116,13 @@ | ||
| 138 | 116 | |
| 139 | 117 | $repeater->add_control( |
| 140 | 118 | 'text', |
| 141 | 119 | [ |
| 142 | - 'label' => esc_html__( 'Text', 'elementor' ), | |
| 120 | + 'label' => __( 'Text', 'elementor' ), | |
| 143 | 121 | 'type' => Controls_Manager::TEXT, |
| 144 | 122 | 'label_block' => true, |
| 145 | - 'placeholder' => esc_html__( 'List Item', 'elementor' ), | |
| 146 | - 'default' => esc_html__( 'List Item', 'elementor' ), | |
| 123 | + 'placeholder' => __( 'List Item', 'elementor' ), | |
| 124 | + 'default' => __( 'List Item', 'elementor' ), | |
| 147 | 125 | 'dynamic' => [ |
| 148 | 126 | 'active' => true, |
| 149 | 127 | ], |
| 150 | 128 | ] |
| @@ -152,9 +130,9 @@ | ||
| 152 | 130 | |
| 153 | 131 | $repeater->add_control( |
| 154 | 132 | 'selected_icon', |
| 155 | 133 | [ |
| 156 | - 'label' => esc_html__( 'Icon', 'elementor' ), | |
| 134 | + 'label' => __( 'Icon', 'elementor' ), | |
| 157 | 135 | 'type' => Controls_Manager::ICONS, |
| 158 | 136 | 'default' => [ |
| 159 | 137 | 'value' => 'fas fa-check', |
| 160 | 138 | 'library' => 'fa-solid', |
| @@ -165,13 +143,14 @@ | ||
| 165 | 143 | |
| 166 | 144 | $repeater->add_control( |
| 167 | 145 | 'link', |
| 168 | 146 | [ |
| 169 | - 'label' => esc_html__( 'Link', 'elementor' ), | |
| 147 | + 'label' => __( 'Link', 'elementor' ), | |
| 170 | 148 | 'type' => Controls_Manager::URL, |
| 171 | 149 | 'dynamic' => [ |
| 172 | 150 | 'active' => true, |
| 173 | 151 | ], |
| 152 | + 'placeholder' => __( 'https://your-link.com', 'elementor' ), | |
| 174 | 153 | ] |
| 175 | 154 | ); |
| 176 | 155 | |
| 177 | 156 | $this->add_control( |
| @@ -176,14 +155,14 @@ | ||
| 176 | 155 | |
| 177 | 156 | $this->add_control( |
| 178 | 157 | 'icon_list', |
| 179 | 158 | [ |
| 180 | - 'label' => esc_html__( 'Items', 'elementor' ), | |
| 159 | + 'label' => __( 'Items', 'elementor' ), | |
| 181 | 160 | 'type' => Controls_Manager::REPEATER, |
| 182 | 161 | 'fields' => $repeater->get_controls(), |
| 183 | 162 | 'default' => [ |
| 184 | 163 | [ |
| 185 | - 'text' => esc_html__( 'List Item #1', 'elementor' ), | |
| 164 | + 'text' => __( 'List Item #1', 'elementor' ), | |
| 186 | 165 | 'selected_icon' => [ |
| 187 | 166 | 'value' => 'fas fa-check', |
| 188 | 167 | 'library' => 'fa-solid', |
| 189 | 168 | ], |
| @@ -188,9 +167,9 @@ | ||
| 188 | 167 | 'library' => 'fa-solid', |
| 189 | 168 | ], |
| 190 | 169 | ], |
| 191 | 170 | [ |
| 192 | - 'text' => esc_html__( 'List Item #2', 'elementor' ), | |
| 171 | + 'text' => __( 'List Item #2', 'elementor' ), | |
| 193 | 172 | 'selected_icon' => [ |
| 194 | 173 | 'value' => 'fas fa-times', |
| 195 | 174 | 'library' => 'fa-solid', |
| 196 | 175 | ], |
| @@ -195,9 +174,9 @@ | ||
| 195 | 174 | 'library' => 'fa-solid', |
| 196 | 175 | ], |
| 197 | 176 | ], |
| 198 | 177 | [ |
| 199 | - 'text' => esc_html__( 'List Item #3', 'elementor' ), | |
| 178 | + 'text' => __( 'List Item #3', 'elementor' ), | |
| 200 | 179 | 'selected_icon' => [ |
| 201 | 180 | 'value' => 'fas fa-dot-circle', |
| 202 | 181 | 'library' => 'fa-solid', |
| 203 | 182 | ], |
| @@ -209,13 +188,13 @@ | ||
| 209 | 188 | |
| 210 | 189 | $this->add_control( |
| 211 | 190 | 'link_click', |
| 212 | 191 | [ |
| 213 | - 'label' => esc_html__( 'Apply Link On', 'elementor' ), | |
| 192 | + 'label' => __( 'Apply Link On', 'elementor' ), | |
| 214 | 193 | 'type' => Controls_Manager::SELECT, |
| 215 | 194 | 'options' => [ |
| 216 | - 'full_width' => esc_html__( 'Full Width', 'elementor' ), | |
| 217 | - 'inline' => esc_html__( 'Inline', 'elementor' ), | |
| 195 | + 'full_width' => __( 'Full Width', 'elementor' ), | |
| 196 | + 'inline' => __( 'Inline', 'elementor' ), | |
| 218 | 197 | ], |
| 219 | 198 | 'default' => 'full_width', |
| 220 | 199 | 'separator' => 'before', |
| 221 | 200 | 'prefix_class' => 'elementor-list-item-link-', |
| @@ -226,9 +205,9 @@ | ||
| 226 | 205 | |
| 227 | 206 | $this->start_controls_section( |
| 228 | 207 | 'section_icon_list', |
| 229 | 208 | [ |
| 230 | - 'label' => esc_html__( 'List', 'elementor' ), | |
| 209 | + 'label' => __( 'List', 'elementor' ), | |
| 231 | 210 | 'tab' => Controls_Manager::TAB_STYLE, |
| 232 | 211 | ] |
| 233 | 212 | ); |
| 234 | 213 | |
| @@ -234,11 +213,10 @@ | ||
| 234 | 213 | |
| 235 | 214 | $this->add_responsive_control( |
| 236 | 215 | 'space_between', |
| 237 | 216 | [ |
| 238 | - 'label' => esc_html__( 'Space Between', 'elementor' ), | |
| 217 | + 'label' => __( 'Space Between', 'elementor' ), | |
| 239 | 218 | 'type' => Controls_Manager::SLIDER, |
| 240 | - 'size_units' => [ 'px', 'em', 'rem', 'custom' ], | |
| 241 | 219 | 'range' => [ |
| 242 | 220 | 'px' => [ |
| 243 | 221 | 'max' => 50, |
| 244 | 222 | ], |
| @@ -243,13 +221,14 @@ | ||
| 243 | 221 | 'max' => 50, |
| 244 | 222 | ], |
| 245 | 223 | ], |
| 246 | 224 | 'selectors' => [ |
| 247 | - '{{WRAPPER}} .elementor-icon-list-items:not(.elementor-inline-items) .elementor-icon-list-item:not(:last-child)' => 'padding-block-end: calc({{SIZE}}{{UNIT}}/2)', | |
| 248 | - '{{WRAPPER}} .elementor-icon-list-items:not(.elementor-inline-items) .elementor-icon-list-item:not(:first-child)' => 'margin-block-start: calc({{SIZE}}{{UNIT}}/2)', | |
| 249 | - '{{WRAPPER}} .elementor-icon-list-items.elementor-inline-items .elementor-icon-list-item' => 'margin-inline: calc({{SIZE}}{{UNIT}}/2)', | |
| 250 | - '{{WRAPPER}} .elementor-icon-list-items.elementor-inline-items' => 'margin-inline: calc(-{{SIZE}}{{UNIT}}/2)', | |
| 251 | - '{{WRAPPER}} .elementor-icon-list-items.elementor-inline-items .elementor-icon-list-item:after' => 'inset-inline-end: calc(-{{SIZE}}{{UNIT}}/2)', | |
| 225 | + '{{WRAPPER}} .elementor-icon-list-items:not(.elementor-inline-items) .elementor-icon-list-item:not(:last-child)' => 'padding-bottom: calc({{SIZE}}{{UNIT}}/2)', | |
| 226 | + '{{WRAPPER}} .elementor-icon-list-items:not(.elementor-inline-items) .elementor-icon-list-item:not(:first-child)' => 'margin-top: calc({{SIZE}}{{UNIT}}/2)', | |
| 227 | + '{{WRAPPER}} .elementor-icon-list-items.elementor-inline-items .elementor-icon-list-item' => 'margin-right: calc({{SIZE}}{{UNIT}}/2); margin-left: calc({{SIZE}}{{UNIT}}/2)', | |
| 228 | + '{{WRAPPER}} .elementor-icon-list-items.elementor-inline-items' => 'margin-right: calc(-{{SIZE}}{{UNIT}}/2); margin-left: calc(-{{SIZE}}{{UNIT}}/2)', | |
| 229 | + 'body.rtl {{WRAPPER}} .elementor-icon-list-items.elementor-inline-items .elementor-icon-list-item:after' => 'left: calc(-{{SIZE}}{{UNIT}}/2)', | |
| 230 | + 'body:not(.rtl) {{WRAPPER}} .elementor-icon-list-items.elementor-inline-items .elementor-icon-list-item:after' => 'right: calc(-{{SIZE}}{{UNIT}}/2)', | |
| 252 | 231 | ], |
| 253 | 232 | ] |
| 254 | 233 | ); |
| 255 | 234 | |
| @@ -255,30 +234,25 @@ | ||
| 255 | 234 | |
| 256 | 235 | $this->add_responsive_control( |
| 257 | 236 | 'icon_align', |
| 258 | 237 | [ |
| 259 | - 'label' => esc_html__( 'Alignment', 'elementor' ), | |
| 238 | + 'label' => __( 'Alignment', 'elementor' ), | |
| 260 | 239 | 'type' => Controls_Manager::CHOOSE, |
| 261 | 240 | 'options' => [ |
| 262 | - 'start' => [ | |
| 263 | - 'title' => esc_html__( 'Start', 'elementor' ), | |
| 241 | + 'left' => [ | |
| 242 | + 'title' => __( 'Left', 'elementor' ), | |
| 264 | 243 | 'icon' => 'eicon-h-align-left', |
| 265 | 244 | ], |
| 266 | 245 | 'center' => [ |
| 267 | - 'title' => esc_html__( 'Center', 'elementor' ), | |
| 246 | + 'title' => __( 'Center', 'elementor' ), | |
| 268 | 247 | 'icon' => 'eicon-h-align-center', |
| 269 | 248 | ], |
| 270 | - 'end' => [ | |
| 271 | - 'title' => esc_html__( 'End', 'elementor' ), | |
| 249 | + 'right' => [ | |
| 250 | + 'title' => __( 'Right', 'elementor' ), | |
| 272 | 251 | 'icon' => 'eicon-h-align-right', |
| 273 | 252 | ], |
| 274 | 253 | ], |
| 275 | - 'classes_dictionary' => [ | |
| 276 | - 'left' => is_rtl() ? 'end' : 'start', | |
| 277 | - 'right' => is_rtl() ? 'start' : 'end', | |
| 278 | - ], | |
| 279 | 254 | 'prefix_class' => 'elementor%s-align-', |
| 280 | - 'classes' => 'elementor-control-start-end', | |
| 281 | 255 | ] |
| 282 | 256 | ); |
| 283 | 257 | |
| 284 | 258 | $this->add_control( |
| @@ -283,12 +257,12 @@ | ||
| 283 | 257 | |
| 284 | 258 | $this->add_control( |
| 285 | 259 | 'divider', |
| 286 | 260 | [ |
| 287 | - 'label' => esc_html__( 'Divider', 'elementor' ), | |
| 261 | + 'label' => __( 'Divider', 'elementor' ), | |
| 288 | 262 | 'type' => Controls_Manager::SWITCHER, |
| 289 | - 'label_off' => esc_html__( 'Off', 'elementor' ), | |
| 290 | - 'label_on' => esc_html__( 'On', 'elementor' ), | |
| 263 | + 'label_off' => __( 'Off', 'elementor' ), | |
| 264 | + 'label_on' => __( 'On', 'elementor' ), | |
| 291 | 265 | 'selectors' => [ |
| 292 | 266 | '{{WRAPPER}} .elementor-icon-list-item:not(:last-child):after' => 'content: ""', |
| 293 | 267 | ], |
| 294 | 268 | 'separator' => 'before', |
| @@ -297,15 +271,15 @@ | ||
| 297 | 271 | |
| 298 | 272 | $this->add_control( |
| 299 | 273 | 'divider_style', |
| 300 | 274 | [ |
| 301 | - 'label' => esc_html__( 'Style', 'elementor' ), | |
| 275 | + 'label' => __( 'Style', 'elementor' ), | |
| 302 | 276 | 'type' => Controls_Manager::SELECT, |
| 303 | 277 | 'options' => [ |
| 304 | - 'solid' => esc_html__( 'Solid', 'elementor' ), | |
| 305 | - 'double' => esc_html__( 'Double', 'elementor' ), | |
| 306 | - 'dotted' => esc_html__( 'Dotted', 'elementor' ), | |
| 307 | - 'dashed' => esc_html__( 'Dashed', 'elementor' ), | |
| 278 | + 'solid' => __( 'Solid', 'elementor' ), | |
| 279 | + 'double' => __( 'Double', 'elementor' ), | |
| 280 | + 'dotted' => __( 'Dotted', 'elementor' ), | |
| 281 | + 'dashed' => __( 'Dashed', 'elementor' ), | |
| 308 | 282 | ], |
| 309 | 283 | 'default' => 'solid', |
| 310 | 284 | 'condition' => [ |
| 311 | 285 | 'divider' => 'yes', |
| @@ -310,10 +284,10 @@ | ||
| 310 | 284 | 'condition' => [ |
| 311 | 285 | 'divider' => 'yes', |
| 312 | 286 | ], |
| 313 | 287 | 'selectors' => [ |
| 314 | - '{{WRAPPER}} .elementor-icon-list-items:not(.elementor-inline-items) .elementor-icon-list-item:not(:last-child):after' => 'border-block-start-style: {{VALUE}}', | |
| 315 | - '{{WRAPPER}} .elementor-icon-list-items.elementor-inline-items .elementor-icon-list-item:not(:last-child):after' => 'border-inline-start-style: {{VALUE}}', | |
| 288 | + '{{WRAPPER}} .elementor-icon-list-items:not(.elementor-inline-items) .elementor-icon-list-item:not(:last-child):after' => 'border-top-style: {{VALUE}}', | |
| 289 | + '{{WRAPPER}} .elementor-icon-list-items.elementor-inline-items .elementor-icon-list-item:not(:last-child):after' => 'border-left-style: {{VALUE}}', | |
| 316 | 290 | ], |
| 317 | 291 | ] |
| 318 | 292 | ); |
| 319 | 293 | |
| @@ -319,11 +293,10 @@ | ||
| 319 | 293 | |
| 320 | 294 | $this->add_control( |
| 321 | 295 | 'divider_weight', |
| 322 | 296 | [ |
| 323 | - 'label' => esc_html__( 'Weight', 'elementor' ), | |
| 297 | + 'label' => __( 'Weight', 'elementor' ), | |
| 324 | 298 | 'type' => Controls_Manager::SLIDER, |
| 325 | - 'size_units' => [ 'px', 'em', 'rem', 'custom' ], | |
| 326 | 299 | 'default' => [ |
| 327 | 300 | 'size' => 1, |
| 328 | 301 | ], |
| 329 | 302 | 'range' => [ |
| @@ -335,10 +308,10 @@ | ||
| 335 | 308 | 'condition' => [ |
| 336 | 309 | 'divider' => 'yes', |
| 337 | 310 | ], |
| 338 | 311 | 'selectors' => [ |
| 339 | - '{{WRAPPER}} .elementor-icon-list-items:not(.elementor-inline-items) .elementor-icon-list-item:not(:last-child):after' => 'border-block-start-width: {{SIZE}}{{UNIT}}', | |
| 340 | - '{{WRAPPER}} .elementor-inline-items .elementor-icon-list-item:not(:last-child):after' => 'border-inline-start-width: {{SIZE}}{{UNIT}}', | |
| 312 | + '{{WRAPPER}} .elementor-icon-list-items:not(.elementor-inline-items) .elementor-icon-list-item:not(:last-child):after' => 'border-top-width: {{SIZE}}{{UNIT}}', | |
| 313 | + '{{WRAPPER}} .elementor-inline-items .elementor-icon-list-item:not(:last-child):after' => 'border-left-width: {{SIZE}}{{UNIT}}', | |
| 341 | 314 | ], |
| 342 | 315 | ] |
| 343 | 316 | ); |
| 344 | 317 | |
| @@ -344,11 +317,10 @@ | ||
| 344 | 317 | |
| 345 | 318 | $this->add_control( |
| 346 | 319 | 'divider_width', |
| 347 | 320 | [ |
| 348 | - 'label' => esc_html__( 'Width', 'elementor' ), | |
| 321 | + 'label' => __( 'Width', 'elementor' ), | |
| 349 | 322 | 'type' => Controls_Manager::SLIDER, |
| 350 | - 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], | |
| 351 | 323 | 'default' => [ |
| 352 | 324 | 'unit' => '%', |
| 353 | 325 | ], |
| 354 | 326 | 'condition' => [ |
| @@ -363,11 +335,11 @@ | ||
| 363 | 335 | |
| 364 | 336 | $this->add_control( |
| 365 | 337 | 'divider_height', |
| 366 | 338 | [ |
| 367 | - 'label' => esc_html__( 'Height', 'elementor' ), | |
| 339 | + 'label' => __( 'Height', 'elementor' ), | |
| 368 | 340 | 'type' => Controls_Manager::SLIDER, |
| 369 | - 'size_units' => [ 'px', '%', 'em', 'rem', 'vh', 'custom' ], | |
| 341 | + 'size_units' => [ '%', 'px' ], | |
| 370 | 342 | 'default' => [ |
| 371 | 343 | 'unit' => '%', |
| 372 | 344 | ], |
| 373 | 345 | 'range' => [ |
| @@ -378,12 +350,8 @@ | ||
| 378 | 350 | '%' => [ |
| 379 | 351 | 'min' => 1, |
| 380 | 352 | 'max' => 100, |
| 381 | 353 | ], |
| 382 | - 'vh' => [ | |
| 383 | - 'min' => 1, | |
| 384 | - 'max' => 100, | |
| 385 | - ], | |
| 386 | 354 | ], |
| 387 | 355 | 'condition' => [ |
| 388 | 356 | 'divider' => 'yes', |
| 389 | 357 | 'view' => 'inline', |
| @@ -396,9 +364,9 @@ | ||
| 396 | 364 | |
| 397 | 365 | $this->add_control( |
| 398 | 366 | 'divider_color', |
| 399 | 367 | [ |
| 400 | - 'label' => esc_html__( 'Color', 'elementor' ), | |
| 368 | + 'label' => __( 'Color', 'elementor' ), | |
| 401 | 369 | 'type' => Controls_Manager::COLOR, |
| 402 | 370 | 'default' => '#ddd', |
| 403 | 371 | 'global' => [ |
| 404 | 372 | 'default' => Global_Colors::COLOR_TEXT, |
| @@ -416,26 +384,17 @@ | ||
| 416 | 384 | |
| 417 | 385 | $this->start_controls_section( |
| 418 | 386 | 'section_icon_style', |
| 419 | 387 | [ |
| 420 | - 'label' => esc_html__( 'Icon', 'elementor' ), | |
| 388 | + 'label' => __( 'Icon', 'elementor' ), | |
| 421 | 389 | 'tab' => Controls_Manager::TAB_STYLE, |
| 422 | 390 | ] |
| 423 | 391 | ); |
| 424 | 392 | |
| 425 | - $this->start_controls_tabs( 'icon_colors' ); | |
| 426 | - | |
| 427 | - $this->start_controls_tab( | |
| 428 | - 'icon_colors_normal', | |
| 429 | - [ | |
| 430 | - 'label' => esc_html__( 'Normal', 'elementor' ), | |
| 431 | - ] | |
| 432 | - ); | |
| 433 | - | |
| 434 | 393 | $this->add_control( |
| 435 | 394 | 'icon_color', |
| 436 | 395 | [ |
| 437 | - 'label' => esc_html__( 'Color', 'elementor' ), | |
| 396 | + 'label' => __( 'Color', 'elementor' ), | |
| 438 | 397 | 'type' => Controls_Manager::COLOR, |
| 439 | 398 | 'default' => '', |
| 440 | 399 | 'selectors' => [ |
| 441 | 400 | '{{WRAPPER}} .elementor-icon-list-icon i' => 'color: {{VALUE}};', |
| @@ -446,21 +405,12 @@ | ||
| 446 | 405 | ], |
| 447 | 406 | ] |
| 448 | 407 | ); |
| 449 | 408 | |
| 450 | - $this->end_controls_tab(); | |
| 451 | - | |
| 452 | - $this->start_controls_tab( | |
| 453 | - 'icon_colors_hover', | |
| 454 | - [ | |
| 455 | - 'label' => esc_html__( 'Hover', 'elementor' ), | |
| 456 | - ] | |
| 457 | - ); | |
| 458 | - | |
| 459 | 409 | $this->add_control( |
| 460 | 410 | 'icon_color_hover', |
| 461 | 411 | [ |
| 462 | - 'label' => esc_html__( 'Color', 'elementor' ), | |
| 412 | + 'label' => __( 'Hover', 'elementor' ), | |
| 463 | 413 | 'type' => Controls_Manager::COLOR, |
| 464 | 414 | 'default' => '', |
| 465 | 415 | 'selectors' => [ |
| 466 | 416 | '{{WRAPPER}} .elementor-icon-list-item:hover .elementor-icon-list-icon i' => 'color: {{VALUE}};', |
| @@ -468,35 +418,13 @@ | ||
| 468 | 418 | ], |
| 469 | 419 | ] |
| 470 | 420 | ); |
| 471 | 421 | |
| 472 | - $this->add_control( | |
| 473 | - 'icon_color_hover_transition', | |
| 474 | - [ | |
| 475 | - 'label' => esc_html__( 'Transition Duration', 'elementor' ), | |
| 476 | - 'type' => Controls_Manager::SLIDER, | |
| 477 | - 'size_units' => [ 's', 'ms', 'custom' ], | |
| 478 | - 'default' => [ | |
| 479 | - 'unit' => 's', | |
| 480 | - 'size' => 0.3, | |
| 481 | - ], | |
| 482 | - 'selectors' => [ | |
| 483 | - '{{WRAPPER}} .elementor-icon-list-icon i' => 'transition: color {{SIZE}}{{UNIT}}', | |
| 484 | - '{{WRAPPER}} .elementor-icon-list-icon svg' => 'transition: fill {{SIZE}}{{UNIT}}', | |
| 485 | - ], | |
| 486 | - ] | |
| 487 | - ); | |
| 488 | - | |
| 489 | - $this->end_controls_tab(); | |
| 490 | - | |
| 491 | - $this->end_controls_tabs(); | |
| 492 | - | |
| 493 | 422 | $this->add_responsive_control( |
| 494 | 423 | 'icon_size', |
| 495 | 424 | [ |
| 496 | - 'label' => esc_html__( 'Size', 'elementor' ), | |
| 425 | + 'label' => __( 'Size', 'elementor' ), | |
| 497 | 426 | 'type' => Controls_Manager::SLIDER, |
| 498 | - 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], | |
| 499 | 427 | 'default' => [ |
| 500 | 428 | 'size' => 14, |
| 501 | 429 | ], |
| 502 | 430 | 'range' => [ |
| @@ -502,169 +430,56 @@ | ||
| 502 | 430 | 'range' => [ |
| 503 | 431 | 'px' => [ |
| 504 | 432 | 'min' => 6, |
| 505 | 433 | ], |
| 506 | - '%' => [ | |
| 507 | - 'min' => 6, | |
| 508 | - ], | |
| 509 | - 'vw' => [ | |
| 510 | - 'min' => 6, | |
| 511 | - ], | |
| 512 | 434 | ], |
| 513 | - 'separator' => 'before', | |
| 514 | 435 | 'selectors' => [ |
| 515 | - '{{WRAPPER}}' => '--e-icon-list-icon-size: {{SIZE}}{{UNIT}};', | |
| 436 | + '{{WRAPPER}} .elementor-icon-list-icon i' => 'font-size: {{SIZE}}{{UNIT}};', | |
| 437 | + '{{WRAPPER}} .elementor-icon-list-icon svg' => 'width: {{SIZE}}{{UNIT}};', | |
| 516 | 438 | ], |
| 517 | 439 | ] |
| 518 | 440 | ); |
| 519 | 441 | |
| 520 | - $this->add_control( | |
| 521 | - 'text_indent', | |
| 522 | - [ | |
| 523 | - 'label' => esc_html__( 'Gap', 'elementor' ), | |
| 524 | - 'type' => Controls_Manager::SLIDER, | |
| 525 | - 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ], | |
| 526 | - 'range' => [ | |
| 527 | - 'px' => [ | |
| 528 | - 'max' => 50, | |
| 529 | - ], | |
| 530 | - ], | |
| 531 | - 'separator' => 'after', | |
| 532 | - 'selectors' => [ | |
| 533 | - '{{WRAPPER}} .elementor-icon-list-icon' => 'padding-inline-end: {{SIZE}}{{UNIT}};', | |
| 534 | - ], | |
| 535 | - ] | |
| 536 | - ); | |
| 537 | - | |
| 538 | - $e_icon_list_icon_css_var = 'var(--e-icon-list-icon-size, 1em)'; | |
| 539 | - $e_icon_list_icon_align_left = sprintf( '0 calc(%s * 0.25) 0 0', $e_icon_list_icon_css_var ); | |
| 540 | - $e_icon_list_icon_align_center = sprintf( '0 calc(%s * 0.125)', $e_icon_list_icon_css_var ); | |
| 541 | - $e_icon_list_icon_align_right = sprintf( '0 0 0 calc(%s * 0.25)', $e_icon_list_icon_css_var ); | |
| 542 | - | |
| 543 | 442 | $this->add_responsive_control( |
| 544 | 443 | 'icon_self_align', |
| 545 | 444 | [ |
| 546 | - 'label' => esc_html__( 'Horizontal Alignment', 'elementor' ), | |
| 445 | + 'label' => __( 'Alignment', 'elementor' ), | |
| 547 | 446 | 'type' => Controls_Manager::CHOOSE, |
| 548 | 447 | 'options' => [ |
| 549 | 448 | 'left' => [ |
| 550 | - 'title' => esc_html__( 'Left', 'elementor' ), | |
| 449 | + 'title' => __( 'Left', 'elementor' ), | |
| 551 | 450 | 'icon' => 'eicon-h-align-left', |
| 552 | 451 | ], |
| 553 | 452 | 'center' => [ |
| 554 | - 'title' => esc_html__( 'Center', 'elementor' ), | |
| 453 | + 'title' => __( 'Center', 'elementor' ), | |
| 555 | 454 | 'icon' => 'eicon-h-align-center', |
| 556 | 455 | ], |
| 557 | 456 | 'right' => [ |
| 558 | - 'title' => esc_html__( 'Right', 'elementor' ), | |
| 457 | + 'title' => __( 'Right', 'elementor' ), | |
| 559 | 458 | 'icon' => 'eicon-h-align-right', |
| 560 | 459 | ], |
| 561 | 460 | ], |
| 562 | 461 | 'default' => '', |
| 563 | - 'selectors_dictionary' => [ | |
| 564 | - 'left' => sprintf( '--e-icon-list-icon-align: left; --e-icon-list-icon-margin: %s;', $e_icon_list_icon_align_left ), | |
| 565 | - 'center' => sprintf( '--e-icon-list-icon-align: center; --e-icon-list-icon-margin: %s;', $e_icon_list_icon_align_center ), | |
| 566 | - 'right' => sprintf( '--e-icon-list-icon-align: right; --e-icon-list-icon-margin: %s;', $e_icon_list_icon_align_right ), | |
| 567 | - ], | |
| 568 | 462 | 'selectors' => [ |
| 569 | - '{{WRAPPER}}' => '{{VALUE}}', | |
| 463 | + '{{WRAPPER}} .elementor-icon-list-icon' => 'text-align: {{VALUE}};', | |
| 570 | 464 | ], |
| 571 | 465 | ] |
| 572 | 466 | ); |
| 573 | 467 | |
| 574 | - $this->add_responsive_control( | |
| 575 | - 'icon_self_vertical_align', | |
| 576 | - [ | |
| 577 | - 'label' => esc_html__( 'Vertical Alignment', 'elementor' ), | |
| 578 | - 'type' => Controls_Manager::CHOOSE, | |
| 579 | - 'options' => [ | |
| 580 | - 'flex-start' => [ | |
| 581 | - 'title' => esc_html__( 'Start', 'elementor' ), | |
| 582 | - 'icon' => 'eicon-v-align-top', | |
| 583 | - ], | |
| 584 | - 'center' => [ | |
| 585 | - 'title' => esc_html__( 'Center', 'elementor' ), | |
| 586 | - 'icon' => 'eicon-v-align-middle', | |
| 587 | - ], | |
| 588 | - 'flex-end' => [ | |
| 589 | - 'title' => esc_html__( 'End', 'elementor' ), | |
| 590 | - 'icon' => 'eicon-v-align-bottom', | |
| 591 | - ], | |
| 592 | - ], | |
| 593 | - 'default' => '', | |
| 594 | - 'selectors' => [ | |
| 595 | - '{{WRAPPER}}' => '--icon-vertical-align: {{VALUE}};', | |
| 596 | - ], | |
| 597 | - ] | |
| 598 | - ); | |
| 599 | - | |
| 600 | - $this->add_responsive_control( | |
| 601 | - 'icon_vertical_offset', | |
| 602 | - [ | |
| 603 | - 'label' => esc_html__( 'Adjust Vertical Position', 'elementor' ), | |
| 604 | - 'type' => Controls_Manager::SLIDER, | |
| 605 | - 'size_units' => [ 'px', 'em', 'rem', 'custom' ], | |
| 606 | - 'default' => [ | |
| 607 | - 'size' => 0, | |
| 608 | - ], | |
| 609 | - 'range' => [ | |
| 610 | - 'px' => [ | |
| 611 | - 'min' => -15, | |
| 612 | - 'max' => 15, | |
| 613 | - ], | |
| 614 | - 'em' => [ | |
| 615 | - 'min' => -1, | |
| 616 | - 'max' => 1, | |
| 617 | - ], | |
| 618 | - ], | |
| 619 | - 'selectors' => [ | |
| 620 | - '{{WRAPPER}}' => '--icon-vertical-offset: {{SIZE}}{{UNIT}};', | |
| 621 | - ], | |
| 622 | - ] | |
| 623 | - ); | |
| 624 | - | |
| 625 | 468 | $this->end_controls_section(); |
| 626 | 469 | |
| 627 | 470 | $this->start_controls_section( |
| 628 | 471 | 'section_text_style', |
| 629 | 472 | [ |
| 630 | - 'label' => esc_html__( 'Text', 'elementor' ), | |
| 473 | + 'label' => __( 'Text', 'elementor' ), | |
| 631 | 474 | 'tab' => Controls_Manager::TAB_STYLE, |
| 632 | 475 | ] |
| 633 | 476 | ); |
| 634 | 477 | |
| 635 | - $this->add_group_control( | |
| 636 | - Group_Control_Typography::get_type(), | |
| 637 | - [ | |
| 638 | - 'name' => 'icon_typography', | |
| 639 | - 'selector' => '{{WRAPPER}} .elementor-icon-list-item > .elementor-icon-list-text, {{WRAPPER}} .elementor-icon-list-item > a', | |
| 640 | - 'global' => [ | |
| 641 | - 'default' => Global_Typography::TYPOGRAPHY_TEXT, | |
| 642 | - ], | |
| 643 | - ] | |
| 644 | - ); | |
| 645 | - | |
| 646 | - $this->add_group_control( | |
| 647 | - Group_Control_Text_Shadow::get_type(), | |
| 648 | - [ | |
| 649 | - 'name' => 'text_shadow', | |
| 650 | - 'selector' => '{{WRAPPER}} .elementor-icon-list-text', | |
| 651 | - ] | |
| 652 | - ); | |
| 653 | - | |
| 654 | - $this->start_controls_tabs( 'text_colors' ); | |
| 655 | - | |
| 656 | - $this->start_controls_tab( | |
| 657 | - 'text_colors_normal', | |
| 658 | - [ | |
| 659 | - 'label' => esc_html__( 'Normal', 'elementor' ), | |
| 660 | - ] | |
| 661 | - ); | |
| 662 | - | |
| 663 | 478 | $this->add_control( |
| 664 | 479 | 'text_color', |
| 665 | 480 | [ |
| 666 | - 'label' => esc_html__( 'Color', 'elementor' ), | |
| 481 | + 'label' => __( 'Text Color', 'elementor' ), | |
| 667 | 482 | 'type' => Controls_Manager::COLOR, |
| 668 | 483 | 'default' => '', |
| 669 | 484 | 'selectors' => [ |
| 670 | 485 | '{{WRAPPER}} .elementor-icon-list-text' => 'color: {{VALUE}};', |
| @@ -674,21 +489,12 @@ | ||
| 674 | 489 | ], |
| 675 | 490 | ] |
| 676 | 491 | ); |
| 677 | 492 | |
| 678 | - $this->end_controls_tab(); | |
| 679 | - | |
| 680 | - $this->start_controls_tab( | |
| 681 | - 'text_colors_hover', | |
| 682 | - [ | |
| 683 | - 'label' => esc_html__( 'Hover', 'elementor' ), | |
| 684 | - ] | |
| 685 | - ); | |
| 686 | - | |
| 687 | 493 | $this->add_control( |
| 688 | 494 | 'text_color_hover', |
| 689 | 495 | [ |
| 690 | - 'label' => esc_html__( 'Color', 'elementor' ), | |
| 496 | + 'label' => __( 'Hover', 'elementor' ), | |
| 691 | 497 | 'type' => Controls_Manager::COLOR, |
| 692 | 498 | 'default' => '', |
| 693 | 499 | 'selectors' => [ |
| 694 | 500 | '{{WRAPPER}} .elementor-icon-list-item:hover .elementor-icon-list-text' => 'color: {{VALUE}};', |
| @@ -696,27 +502,34 @@ | ||
| 696 | 502 | ] |
| 697 | 503 | ); |
| 698 | 504 | |
| 699 | 505 | $this->add_control( |
| 700 | - 'text_color_hover_transition', | |
| 506 | + 'text_indent', | |
| 701 | 507 | [ |
| 702 | - 'label' => esc_html__( 'Transition Duration', 'elementor' ), | |
| 508 | + 'label' => __( 'Text Indent', 'elementor' ), | |
| 703 | 509 | 'type' => Controls_Manager::SLIDER, |
| 704 | - 'size_units' => [ 's', 'ms', 'custom' ], | |
| 705 | - 'default' => [ | |
| 706 | - 'unit' => 's', | |
| 707 | - 'size' => 0.3, | |
| 510 | + 'range' => [ | |
| 511 | + 'px' => [ | |
| 512 | + 'max' => 50, | |
| 513 | + ], | |
| 708 | 514 | ], |
| 709 | 515 | 'selectors' => [ |
| 710 | - '{{WRAPPER}} .elementor-icon-list-text' => 'transition: color {{SIZE}}{{UNIT}}', | |
| 516 | + '{{WRAPPER}} .elementor-icon-list-text' => is_rtl() ? 'padding-right: {{SIZE}}{{UNIT}};' : 'padding-left: {{SIZE}}{{UNIT}};', | |
| 711 | 517 | ], |
| 712 | 518 | ] |
| 713 | 519 | ); |
| 714 | 520 | |
| 715 | - $this->end_controls_tab(); | |
| 521 | + $this->add_group_control( | |
| 522 | + Group_Control_Typography::get_type(), | |
| 523 | + [ | |
| 524 | + 'name' => 'icon_typography', | |
| 525 | + 'selector' => '{{WRAPPER}} .elementor-icon-list-item, {{WRAPPER}} .elementor-icon-list-item a', | |
| 526 | + 'global' => [ | |
| 527 | + 'default' => Global_Typography::TYPOGRAPHY_TEXT, | |
| 528 | + ], | |
| 529 | + ] | |
| 530 | + ); | |
| 716 | 531 | |
| 717 | - $this->end_controls_tabs(); | |
| 718 | - | |
| 719 | 532 | $this->end_controls_section(); |
| 720 | 533 | } |
| 721 | 534 | |
| 722 | 535 | /** |
| @@ -742,9 +555,9 @@ | ||
| 742 | 555 | $this->add_render_attribute( 'icon_list', 'class', 'elementor-inline-items' ); |
| 743 | 556 | $this->add_render_attribute( 'list_item', 'class', 'elementor-inline-item' ); |
| 744 | 557 | } |
| 745 | 558 | ?> |
| 746 | - <ul <?php $this->print_render_attribute_string( 'icon_list' ); ?>> | |
| 559 | + <ul <?php echo $this->get_render_attribute_string( 'icon_list' ); ?>> | |
| 747 | 560 | <?php |
| 748 | 561 | foreach ( $settings['icon_list'] as $index => $item ) : |
| 749 | 562 | $repeater_setting_key = $this->get_repeater_setting_key( 'text', 'icon_list', $index ); |
| 750 | 563 | |
| @@ -752,18 +565,16 @@ | ||
| 752 | 565 | |
| 753 | 566 | $this->add_inline_editing_attributes( $repeater_setting_key ); |
| 754 | 567 | $migration_allowed = Icons_Manager::is_migration_allowed(); |
| 755 | 568 | ?> |
| 756 | - <li <?php $this->print_render_attribute_string( 'list_item' ); ?>> | |
| 569 | + <li <?php echo $this->get_render_attribute_string( 'list_item' ); ?>> | |
| 757 | 570 | <?php |
| 758 | 571 | if ( ! empty( $item['link']['url'] ) ) { |
| 759 | 572 | $link_key = 'link_' . $index; |
| 760 | 573 | |
| 761 | 574 | $this->add_link_attributes( $link_key, $item['link'] ); |
| 762 | - ?> | |
| 763 | - <a <?php $this->print_render_attribute_string( $link_key ); ?>> | |
| 764 | 575 | |
| 765 | - <?php | |
| 576 | + echo '<a ' . $this->get_render_attribute_string( $link_key ) . '>'; | |
| 766 | 577 | } |
| 767 | 578 | |
| 768 | 579 | // add old default |
| 769 | 580 | if ( ! isset( $item['icon'] ) && ! $migration_allowed ) { |
| @@ -782,9 +593,9 @@ | ||
| 782 | 593 | <i class="<?php echo esc_attr( $item['icon'] ); ?>" aria-hidden="true"></i> |
| 783 | 594 | <?php } ?> |
| 784 | 595 | </span> |
| 785 | 596 | <?php endif; ?> |
| 786 | - <span <?php $this->print_render_attribute_string( $repeater_setting_key ); ?>><?php echo wp_kses_post( $item['text'] ); ?></span> | |
| 597 | + <span <?php echo $this->get_render_attribute_string( $repeater_setting_key ); ?>><?php echo $item['text']; ?></span> | |
| 787 | 598 | <?php if ( ! empty( $item['link']['url'] ) ) : ?> |
| 788 | 599 | </a> |
| 789 | 600 | <?php endif; ?> |
| 790 | 601 | </li> |
| @@ -802,34 +613,8 @@ | ||
| 802 | 613 | * |
| 803 | 614 | * @since 2.9.0 |
| 804 | 615 | * @access protected |
| 805 | 616 | */ |
| 806 | - public function render_markdown(): string { | |
| 807 | - $settings = $this->get_settings_for_display(); | |
| 808 | - | |
| 809 | - if ( empty( $settings['icon_list'] ) ) { | |
| 810 | - return ''; | |
| 811 | - } | |
| 812 | - | |
| 813 | - $lines = []; | |
| 814 | - | |
| 815 | - foreach ( $settings['icon_list'] as $item ) { | |
| 816 | - $text = Utils::html_to_plain_text( $item['text'] ?? '' ); | |
| 817 | - | |
| 818 | - if ( empty( $text ) ) { | |
| 819 | - continue; | |
| 820 | - } | |
| 821 | - | |
| 822 | - if ( ! empty( $item['link']['url'] ) ) { | |
| 823 | - $text = '[' . $text . '](' . esc_url( $item['link']['url'] ) . ')'; | |
| 824 | - } | |
| 825 | - | |
| 826 | - $lines[] = '- ' . $text; | |
| 827 | - } | |
| 828 | - | |
| 829 | - return implode( "\n", $lines ); | |
| 830 | - } | |
| 831 | - | |
| 832 | 617 | protected function content_template() { |
| 833 | 618 | ?> |
| 834 | 619 | <# |
| 835 | 620 | view.addRenderAttribute( 'icon_list', 'class', 'elementor-icon-list-items' ); |
| @@ -852,10 +637,10 @@ | ||
| 852 | 637 | |
| 853 | 638 | view.addInlineEditingAttributes( iconTextKey ); #> |
| 854 | 639 | |
| 855 | 640 | <li {{{ view.getRenderAttributeString( 'list_item' ) }}}> |
| 856 | - <# if ( item.link && item.link?.url ) { #> | |
| 857 | - <a href="{{ elementor.helpers.sanitizeUrl( item.link?.url ) }}"> | |
| 641 | + <# if ( item.link && item.link.url ) { #> | |
| 642 | + <a href="{{ item.link.url }}"> | |
| 858 | 643 | <# } #> |
| 859 | 644 | <# if ( item.icon || item.selected_icon.value ) { #> |
| 860 | 645 | <span class="elementor-icon-list-icon"> |
| 861 | 646 | <# |
| @@ -869,9 +654,9 @@ | ||
| 869 | 654 | #> |
| 870 | 655 | </span> |
| 871 | 656 | <# } #> |
| 872 | 657 | <span {{{ view.getRenderAttributeString( iconTextKey ) }}}>{{{ item.text }}}</span> |
| 873 | - <# if ( item.link && item.link?.url ) { #> | |
| 658 | + <# if ( item.link && item.link.url ) { #> | |
| 874 | 659 | </a> |
| 875 | 660 | <# } #> |
| 876 | 661 | </li> |
| 877 | 662 | <# |