PluginProbe
Elementor Website Builder – more than just a page builder / 3.0.3
Elementor Website Builder – more than just a page builder v3.0.3
4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 All 454 releases
← All changes | includes/widgets/social-icons.php +77 -170 4.3.0-beta2 → 3.0.3 View file →
@@ -38,9 +38,9 @@
38 38 *
39 39 * @return string Widget title.
40 40 */
41 41 public function get_title() {
42 - return esc_html__( 'Social Icons', 'elementor' );
42 + return __( 'Social Icons', 'elementor' );
43 43 }
44 44
45 45 /**
46 46 * Get widget icon.
@@ -69,43 +69,21 @@
69 69 public function get_keywords() {
70 70 return [ 'social', 'icon', 'link' ];
71 71 }
72 72
73 - protected function is_dynamic_content(): bool {
74 - return false;
75 - }
76 -
77 73 /**
78 - * Get style dependencies.
79 - *
80 - * Retrieve the list of style dependencies the widget requires.
81 - *
82 - * @since 3.24.0
83 - * @access public
84 - *
85 - * @return array Widget style dependencies.
86 - */
87 - public function get_style_depends(): array {
88 - return [ 'widget-social-icons', 'e-apple-webkit' ];
89 - }
90 -
91 - public function has_widget_inner_wrapper(): bool {
92 - return ! Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' );
93 - }
94 -
95 - /**
96 74 * Register social icons widget controls.
97 75 *
98 76 * Adds different input fields to allow the user to change and customize the widget settings.
99 77 *
100 - * @since 3.1.0
78 + * @since 1.0.0
101 79 * @access protected
102 80 */
103 - protected function register_controls() {
81 + protected function _register_controls() {
104 82 $this->start_controls_section(
105 83 'section_social_icon',
106 84 [
107 - 'label' => esc_html__( 'Social Icons', 'elementor' ),
85 + 'label' => __( 'Social Icons', 'elementor' ),
108 86 ]
109 87 );
110 88
111 89 $repeater = new Repeater();
@@ -112,9 +90,9 @@
112 90
113 91 $repeater->add_control(
114 92 'social_icon',
115 93 [
116 - 'label' => esc_html__( 'Icon', 'elementor' ),
94 + 'label' => __( 'Icon', 'elementor' ),
117 95 'type' => Controls_Manager::ICONS,
118 96 'fa4compatibility' => 'social',
119 97 'default' => [
120 98 'value' => 'fab fa-wordpress',
@@ -160,9 +138,8 @@
160 138 'stack-overflow',
161 139 'steam',
162 140 'telegram',
163 141 'thumb-tack',
164 - 'threads',
165 142 'tripadvisor',
166 143 'tumblr',
167 144 'twitch',
168 145 'twitter',
@@ -173,9 +150,8 @@
173 150 'weixin',
174 151 'whatsapp',
175 152 'wordpress',
176 153 'xing',
177 - 'x-twitter',
178 154 'yelp',
179 155 'youtube',
180 156 '500px',
181 157 ],
@@ -190,9 +166,9 @@
190 166
191 167 $repeater->add_control(
192 168 'link',
193 169 [
194 - 'label' => esc_html__( 'Link', 'elementor' ),
170 + 'label' => __( 'Link', 'elementor' ),
195 171 'type' => Controls_Manager::URL,
196 172 'default' => [
197 173 'is_external' => 'true',
198 174 ],
@@ -198,8 +174,9 @@
198 174 ],
199 175 'dynamic' => [
200 176 'active' => true,
201 177 ],
178 + 'placeholder' => __( 'https://your-link.com', 'elementor' ),
202 179 ]
203 180 );
204 181
205 182 $repeater->add_control(
@@ -204,14 +181,14 @@
204 181
205 182 $repeater->add_control(
206 183 'item_icon_color',
207 184 [
208 - 'label' => esc_html__( 'Color', 'elementor' ),
185 + 'label' => __( 'Color', 'elementor' ),
209 186 'type' => Controls_Manager::SELECT,
210 187 'default' => 'default',
211 188 'options' => [
212 - 'default' => esc_html__( 'Official Color', 'elementor' ),
213 - 'custom' => esc_html__( 'Custom', 'elementor' ),
189 + 'default' => __( 'Official Color', 'elementor' ),
190 + 'custom' => __( 'Custom', 'elementor' ),
214 191 ],
215 192 ]
216 193 );
217 194
@@ -217,9 +194,9 @@
217 194
218 195 $repeater->add_control(
219 196 'item_icon_primary_color',
220 197 [
221 - 'label' => esc_html__( 'Primary Color', 'elementor' ),
198 + 'label' => __( 'Primary Color', 'elementor' ),
222 199 'type' => Controls_Manager::COLOR,
223 200 'condition' => [
224 201 'item_icon_color' => 'custom',
225 202 ],
@@ -231,9 +208,9 @@
231 208
232 209 $repeater->add_control(
233 210 'item_icon_secondary_color',
234 211 [
235 - 'label' => esc_html__( 'Secondary Color', 'elementor' ),
212 + 'label' => __( 'Secondary Color', 'elementor' ),
236 213 'type' => Controls_Manager::COLOR,
237 214 'condition' => [
238 215 'item_icon_color' => 'custom',
239 216 ],
@@ -246,9 +223,9 @@
246 223
247 224 $this->add_control(
248 225 'social_icon_list',
249 226 [
250 - 'label' => esc_html__( 'Social Icons', 'elementor' ),
227 + 'label' => __( 'Social Icons', 'elementor' ),
251 228 'type' => Controls_Manager::REPEATER,
252 229 'fields' => $repeater->get_controls(),
253 230 'default' => [
254 231 [
@@ -258,9 +235,9 @@
258 235 ],
259 236 ],
260 237 [
261 238 'social_icon' => [
262 - 'value' => 'fab fa-x-twitter',
239 + 'value' => 'fab fa-twitter',
263 240 'library' => 'fa-brands',
264 241 ],
265 242 ],
266 243 [
@@ -276,15 +253,15 @@
276 253
277 254 $this->add_control(
278 255 'shape',
279 256 [
280 - 'label' => esc_html__( 'Shape', 'elementor' ),
257 + 'label' => __( 'Shape', 'elementor' ),
281 258 'type' => Controls_Manager::SELECT,
282 259 'default' => 'rounded',
283 260 'options' => [
284 - 'square' => esc_html__( 'Square', 'elementor' ),
285 - 'rounded' => esc_html__( 'Rounded', 'elementor' ),
286 - 'circle' => esc_html__( 'Circle', 'elementor' ),
261 + 'rounded' => __( 'Rounded', 'elementor' ),
262 + 'square' => __( 'Square', 'elementor' ),
263 + 'circle' => __( 'Circle', 'elementor' ),
287 264 ],
288 265 'prefix_class' => 'elementor-shape-',
289 266 ]
290 267 );
@@ -291,13 +268,13 @@
291 268
292 269 $this->add_responsive_control(
293 270 'columns',
294 271 [
295 - 'label' => esc_html__( 'Columns', 'elementor' ),
272 + 'label' => __( 'Columns', 'elementor' ),
296 273 'type' => Controls_Manager::SELECT,
297 274 'default' => '0',
298 275 'options' => [
299 - '0' => esc_html__( 'Auto', 'elementor' ),
276 + '0' => __( 'Auto', 'elementor' ),
300 277 '1' => '1',
301 278 '2' => '2',
302 279 '3' => '3',
303 280 '4' => '4',
@@ -310,45 +287,56 @@
310 287 ],
311 288 ]
312 289 );
313 290
314 - $align_selector = Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' ) && ! $this->has_widget_inner_wrapper()
315 - ? '{{WRAPPER}}'
316 - : '{{WRAPPER}} .elementor-widget-container';
291 + $start = is_rtl() ? 'end' : 'start';
292 + $end = is_rtl() ? 'start' : 'end';
317 293
318 294 $this->add_responsive_control(
319 295 'align',
320 296 [
321 - 'label' => esc_html__( 'Alignment', 'elementor' ),
297 + 'label' => __( 'Alignment', 'elementor' ),
322 298 'type' => Controls_Manager::CHOOSE,
323 299 'options' => [
324 300 'left' => [
325 - 'title' => esc_html__( 'Left', 'elementor' ),
301 + 'title' => __( 'Left', 'elementor' ),
326 302 'icon' => 'eicon-text-align-left',
327 303 ],
328 304 'center' => [
329 - 'title' => esc_html__( 'Center', 'elementor' ),
305 + 'title' => __( 'Center', 'elementor' ),
330 306 'icon' => 'eicon-text-align-center',
331 307 ],
332 308 'right' => [
333 - 'title' => esc_html__( 'Right', 'elementor' ),
309 + 'title' => __( 'Right', 'elementor' ),
334 310 'icon' => 'eicon-text-align-right',
335 311 ],
336 312 ],
337 - 'prefix_class' => 'e-grid-align%s-',
313 + 'selectors_dictionary' => [
314 + 'left' => 'flex-' . $start,
315 + 'right' => 'flex-' . $end,
316 + ],
338 317 'default' => 'center',
339 318 'selectors' => [
340 - $align_selector => 'text-align: {{VALUE}}',
319 + '{{WRAPPER}} .elementor-widget-container' => 'justify-content: {{VALUE}};',
341 320 ],
342 321 ]
343 322 );
344 323
324 + $this->add_control(
325 + 'view',
326 + [
327 + 'label' => __( 'View', 'elementor' ),
328 + 'type' => Controls_Manager::HIDDEN,
329 + 'default' => 'traditional',
330 + ]
331 + );
332 +
345 333 $this->end_controls_section();
346 334
347 335 $this->start_controls_section(
348 336 'section_social_style',
349 337 [
350 - 'label' => esc_html__( 'Icon', 'elementor' ),
338 + 'label' => __( 'Icon', 'elementor' ),
351 339 'tab' => Controls_Manager::TAB_STYLE,
352 340 ]
353 341 );
354 342
@@ -354,14 +342,14 @@
354 342
355 343 $this->add_control(
356 344 'icon_color',
357 345 [
358 - 'label' => esc_html__( 'Color', 'elementor' ),
346 + 'label' => __( 'Color', 'elementor' ),
359 347 'type' => Controls_Manager::SELECT,
360 348 'default' => 'default',
361 349 'options' => [
362 - 'default' => esc_html__( 'Official Color', 'elementor' ),
363 - 'custom' => esc_html__( 'Custom', 'elementor' ),
350 + 'default' => __( 'Official Color', 'elementor' ),
351 + 'custom' => __( 'Custom', 'elementor' ),
364 352 ],
365 353 ]
366 354 );
367 355
@@ -367,9 +355,9 @@
367 355
368 356 $this->add_control(
369 357 'icon_primary_color',
370 358 [
371 - 'label' => esc_html__( 'Primary Color', 'elementor' ),
359 + 'label' => __( 'Primary Color', 'elementor' ),
372 360 'type' => Controls_Manager::COLOR,
373 361 'condition' => [
374 362 'icon_color' => 'custom',
375 363 ],
@@ -381,9 +369,9 @@
381 369
382 370 $this->add_control(
383 371 'icon_secondary_color',
384 372 [
385 - 'label' => esc_html__( 'Secondary Color', 'elementor' ),
373 + 'label' => __( 'Secondary Color', 'elementor' ),
386 374 'type' => Controls_Manager::COLOR,
387 375 'condition' => [
388 376 'icon_color' => 'custom',
389 377 ],
@@ -396,12 +384,10 @@
396 384
397 385 $this->add_responsive_control(
398 386 'icon_size',
399 387 [
400 - 'label' => esc_html__( 'Size', 'elementor' ),
388 + 'label' => __( 'Size', 'elementor' ),
401 389 'type' => Controls_Manager::SLIDER,
402 - // The `%' and `em` units are not supported as the widget implements icons differently then other icons.
403 - 'size_units' => [ 'px', 'rem', 'vw', 'custom' ],
404 390 'range' => [
405 391 'px' => [
406 392 'min' => 6,
407 393 'max' => 300,
@@ -407,9 +393,9 @@
407 393 'max' => 300,
408 394 ],
409 395 ],
410 396 'selectors' => [
411 - '{{WRAPPER}}' => '--icon-size: {{SIZE}}{{UNIT}}',
397 + '{{WRAPPER}} .elementor-social-icon' => 'font-size: {{SIZE}}{{UNIT}};',
412 398 ],
413 399 ]
414 400 );
415 401
@@ -415,14 +401,12 @@
415 401
416 402 $this->add_responsive_control(
417 403 'icon_padding',
418 404 [
419 - 'label' => esc_html__( 'Padding', 'elementor' ),
405 + 'label' => __( 'Padding', 'elementor' ),
420 406 'type' => Controls_Manager::SLIDER,
421 - // The `%' unit is not supported.
422 - 'size_units' => [ 'px', 'em', 'rem', 'custom' ],
423 407 'selectors' => [
424 - '{{WRAPPER}} .elementor-social-icon' => '--icon-padding: {{SIZE}}{{UNIT}}',
408 + '{{WRAPPER}} .elementor-social-icon' => 'padding: {{SIZE}}{{UNIT}};',
425 409 ],
426 410 'default' => [
427 411 'unit' => 'em',
428 412 ],
@@ -432,19 +416,12 @@
432 416 'mobile_default' => [
433 417 'unit' => 'em',
434 418 ],
435 419 'range' => [
436 - 'px' => [
437 - 'max' => 50,
438 - ],
439 420 'em' => [
440 421 'min' => 0,
441 422 'max' => 5,
442 423 ],
443 - 'rem' => [
444 - 'min' => 0,
445 - 'max' => 5,
446 - ],
447 424 ],
448 425 ]
449 426 );
450 427
@@ -450,29 +427,21 @@
450 427
451 428 $this->add_responsive_control(
452 429 'icon_spacing',
453 430 [
454 - 'label' => esc_html__( 'Spacing', 'elementor' ),
431 + 'label' => __( 'Spacing', 'elementor' ),
455 432 'type' => Controls_Manager::SLIDER,
456 - 'size_units' => [ 'px', 'em', 'rem', 'custom' ],
457 433 'range' => [
458 434 'px' => [
435 + 'min' => 0,
459 436 'max' => 100,
460 437 ],
461 - 'em' => [
462 - 'min' => 0,
463 - 'max' => 10,
464 - ],
465 - 'rem' => [
466 - 'min' => 0,
467 - 'max' => 10,
468 - ],
469 438 ],
470 439 'default' => [
471 440 'size' => 5,
472 441 ],
473 442 'selectors' => [
474 - '{{WRAPPER}}' => '--grid-column-gap: {{SIZE}}{{UNIT}}',
443 + '{{WRAPPER}}' => '--grid-column-gap: {{SIZE}}{{UNIT}}; --grid-side-margin: {{SIZE}}{{UNIT}}',
475 444 ],
476 445 ]
477 446 );
478 447
@@ -478,16 +447,15 @@
478 447
479 448 $this->add_responsive_control(
480 449 'row_gap',
481 450 [
482 - 'label' => esc_html__( 'Rows Gap', 'elementor' ),
451 + 'label' => __( 'Rows Gap', 'elementor' ),
483 452 'type' => Controls_Manager::SLIDER,
484 - 'size_units' => [ 'px', 'em', 'rem', 'custom' ],
485 453 'default' => [
486 454 'size' => 0,
487 455 ],
488 456 'selectors' => [
489 - '{{WRAPPER}}' => '--grid-row-gap: {{SIZE}}{{UNIT}}',
457 + '{{WRAPPER}}' => '--grid-row-gap: {{SIZE}}{{UNIT}}; --grid-bottom-margin: {{SIZE}}{{UNIT}}',
490 458 ],
491 459 ]
492 460 );
493 461
@@ -499,14 +467,14 @@
499 467 'separator' => 'before',
500 468 ]
501 469 );
502 470
503 - $this->add_responsive_control(
471 + $this->add_control(
504 472 'border_radius',
505 473 [
506 - 'label' => esc_html__( 'Border Radius', 'elementor' ),
474 + 'label' => __( 'Border Radius', 'elementor' ),
507 475 'type' => Controls_Manager::DIMENSIONS,
508 - 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ],
476 + 'size_units' => [ 'px', '%' ],
509 477 'selectors' => [
510 478 '{{WRAPPER}} .elementor-icon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
511 479 ],
512 480 ]
@@ -516,9 +484,9 @@
516 484
517 485 $this->start_controls_section(
518 486 'section_social_hover',
519 487 [
520 - 'label' => esc_html__( 'Icon Hover', 'elementor' ),
488 + 'label' => __( 'Icon Hover', 'elementor' ),
521 489 'tab' => Controls_Manager::TAB_STYLE,
522 490 ]
523 491 );
524 492
@@ -524,9 +492,9 @@
524 492
525 493 $this->add_control(
526 494 'hover_primary_color',
527 495 [
528 - 'label' => esc_html__( 'Primary Color', 'elementor' ),
496 + 'label' => __( 'Primary Color', 'elementor' ),
529 497 'type' => Controls_Manager::COLOR,
530 498 'default' => '',
531 499 'condition' => [
532 500 'icon_color' => 'custom',
@@ -539,9 +507,9 @@
539 507
540 508 $this->add_control(
541 509 'hover_secondary_color',
542 510 [
543 - 'label' => esc_html__( 'Secondary Color', 'elementor' ),
511 + 'label' => __( 'Secondary Color', 'elementor' ),
544 512 'type' => Controls_Manager::COLOR,
545 513 'default' => '',
546 514 'condition' => [
547 515 'icon_color' => 'custom',
@@ -555,9 +523,9 @@
555 523
556 524 $this->add_control(
557 525 'hover_border_color',
558 526 [
559 - 'label' => esc_html__( 'Border Color', 'elementor' ),
527 + 'label' => __( 'Border Color', 'elementor' ),
560 528 'type' => Controls_Manager::COLOR,
561 529 'default' => '',
562 530 'condition' => [
563 531 'image_border_border!' => '',
@@ -570,14 +538,15 @@
570 538
571 539 $this->add_control(
572 540 'hover_animation',
573 541 [
574 - 'label' => esc_html__( 'Hover Animation', 'elementor' ),
542 + 'label' => __( 'Hover Animation', 'elementor' ),
575 543 'type' => Controls_Manager::HOVER_ANIMATION,
576 544 ]
577 545 );
578 546
579 547 $this->end_controls_section();
548 +
580 549 }
581 550
582 551 /**
583 552 * Render social icons widget output on the frontend.
@@ -588,20 +557,11 @@
588 557 * @access protected
589 558 */
590 559 protected function render() {
591 560 $settings = $this->get_settings_for_display();
592 -
593 - $this->add_render_attribute( 'wrapper', 'class', [ 'elementor-social-icons-wrapper', 'elementor-grid' ] );
594 - $this->add_render_attribute( 'item_wrapper', 'class', 'elementor-grid-item' );
595 -
596 - if ( count( $settings['social_icon_list'] ) > 1 ) {
597 - $this->add_render_attribute( 'wrapper', 'role', 'list' );
598 - $this->add_render_attribute( 'item_wrapper', 'role', 'listitem' );
599 - }
600 -
601 561 $fallback_defaults = [
602 562 'fa fa-facebook',
603 - 'fa fa-x-twitter',
563 + 'fa fa-twitter',
604 564 'fa fa-google-plus',
605 565 ];
606 566
607 567 $class_animation = '';
@@ -612,9 +572,9 @@
612 572
613 573 $migration_allowed = Icons_Manager::is_migration_allowed();
614 574
615 575 ?>
616 - <div <?php $this->print_render_attribute_string( 'wrapper' ); ?>>
576 + <div class="elementor-social-icons-wrapper elementor-grid">
617 577 <?php
618 578 foreach ( $settings['social_icon_list'] as $index => $item ) {
619 579 $migrated = isset( $item['__fa4_migrated']['social_icon'] );
620 580 $is_new = empty( $item['social'] ) && $migration_allowed;
@@ -652,19 +612,19 @@
652 612
653 613 $this->add_link_attributes( $link_key, $item['link'] );
654 614
655 615 ?>
656 - <span <?php $this->print_render_attribute_string( 'item_wrapper' ); ?>>
657 - <a <?php $this->print_render_attribute_string( $link_key ); ?>>
658 - <span class="elementor-screen-only"><?php echo esc_html( ucwords( $social ) ); ?></span>
616 + <div class="elementor-grid-item">
617 + <a <?php echo $this->get_render_attribute_string( $link_key ); ?>>
618 + <span class="elementor-screen-only"><?php echo ucwords( $social ); ?></span>
659 619 <?php
660 620 if ( $is_new || $migrated ) {
661 - Icons_Manager::render_icon( $item['social_icon'], [ 'aria-hidden' => 'true' ] );
621 + Icons_Manager::render_icon( $item['social_icon'] );
662 622 } else { ?>
663 - <i class="<?php echo esc_attr( $item['social'] ); ?>" aria-hidden="true"></i>
623 + <i class="<?php echo esc_attr( $item['social'] ); ?>"></i>
664 624 <?php } ?>
665 625 </a>
666 - </span>
626 + </div>
667 627 <?php } ?>
668 628 </div>
669 629 <?php
670 630 }
@@ -678,27 +638,17 @@
678 638 * @access protected
679 639 */
680 640 protected function content_template() {
681 641 ?>
682 - <#
683 - view.addRenderAttribute( 'wrapper', 'class', [ 'elementor-social-icons-wrapper', 'elementor-grid' ] );
684 - view.addRenderAttribute( 'item_wrapper', 'class', 'elementor-grid-item' );
685 -
686 - if ( settings.social_icon_list.length > 1 ) {
687 - view.addRenderAttribute( 'wrapper', 'role', 'list' );
688 - view.addRenderAttribute( 'item_wrapper', 'role', 'listitem' );
689 - }
690 -
691 - var iconsHTML = {};
692 - #>
693 - <div {{{ view.getRenderAttributeString( 'wrapper' ) }}}>
642 + <# var iconsHTML = {}; #>
643 + <div class="elementor-social-icons-wrapper elementor-grid">
694 644 <# _.each( settings.social_icon_list, function( item, index ) {
695 645 var link = item.link ? item.link.url : '',
696 646 migrated = elementor.helpers.isIconMigrated( item, 'social_icon' );
697 647 social = elementor.helpers.getSocialNetworkNameFromIcon( item.social_icon, item.social, false, migrated );
698 648 #>
699 - <span {{{ view.getRenderAttributeString( 'item_wrapper' ) }}}>
700 - <a class="elementor-icon elementor-social-icon elementor-social-icon-{{ social }} elementor-animation-{{ settings.hover_animation }} elementor-repeater-item-{{item._id}}" href="{{ elementor.helpers.sanitizeUrl( link ) }}">
649 + <div class="elementor-grid-item">
650 + <a class="elementor-icon elementor-social-icon elementor-social-icon-{{ social }} elementor-animation-{{ settings.hover_animation }} elementor-repeater-item-{{item._id}}" href="{{ link }}">
701 651 <span class="elementor-screen-only">{{{ social }}}</span>
702 652 <#
703 653 iconsHTML[ index ] = elementor.helpers.renderIcon( view, item.social_icon, {}, 'i', 'object' );
704 654 if ( ( ! item.social || migrated ) && iconsHTML[ index ] && iconsHTML[ index ].rendered ) { #>
@@ -707,53 +657,10 @@
707 657 <i class="{{ item.social }}"></i>
708 658 <# }
709 659 #>
710 660 </a>
711 - </span>
661 + </div>
712 662 <# } ); #>
713 663 </div>
714 664 <?php
715 - }
716 -
717 - public function render_markdown(): string {
718 - $settings = $this->get_settings_for_display();
719 - if ( empty( $settings['social_icon_list'] ) ) {
720 - return '';
721 - }
722 -
723 - $migration_allowed = Icons_Manager::is_migration_allowed();
724 - $links = [];
725 -
726 - foreach ( $settings['social_icon_list'] as $item ) {
727 - $url = $item['link']['url'] ?? '';
728 - if ( empty( $url ) ) {
729 - continue;
730 - }
731 -
732 - $migrated = isset( $item['__fa4_migrated']['social_icon'] );
733 - $is_new = empty( $item['social'] ) && $migration_allowed;
734 - $social = '';
735 -
736 - if ( ! empty( $item['social'] ) ) {
737 - $social = str_replace( 'fa fa-', '', $item['social'] );
738 - }
739 -
740 - if ( ( $is_new || $migrated ) && 'svg' !== ( $item['social_icon']['library'] ?? '' ) ) {
741 - $parts = explode( ' ', $item['social_icon']['value'] ?? '', 2 );
742 - $social = ! empty( $parts[1] ) ? str_replace( 'fa-', '', $parts[1] ) : '';
743 - }
744 -
745 - if ( 'svg' === ( $item['social_icon']['library'] ?? '' ) ) {
746 - $social = get_post_meta( $item['social_icon']['value']['id'] ?? 0, '_wp_attachment_image_alt', true );
747 - }
748 -
749 - $label = ucwords( str_replace( '-', ' ', $social ) );
750 - if ( empty( $label ) ) {
751 - $label = 'Link';
752 - }
753 -
754 - $links[] = '- [' . $label . '](' . esc_url( $url ) . ')';
755 - }
756 -
757 - return implode( "\n", $links );
758 665 }
759 666 }