Changeset 3462759
- Timestamp:
- 02/16/2026 05:36:52 PM (7 days ago)
- Location:
- a1-tools/trunk
- Files:
-
- 3 edited
-
a1-tools.php (modified) (9 diffs)
-
includes/class-a1-tools-elementor-widget.php (modified) (4 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
a1-tools/trunk/a1-tools.php
r3458218 r3462759 4 4 * Plugin URI: https://tools.a-1chimney.com 5 5 * Description: Connects your WordPress site to the A1 Tools platform for centralized management of contact information, social media links, and business details. 6 * Version: 1.4.1 06 * Version: 1.4.11 7 7 * Requires at least: 5.0 8 8 * Requires PHP: 7.4 … … 21 21 22 22 // Plugin constants. 23 define( 'A1TOOLS_VERSION', '1.4.1 0' );23 define( 'A1TOOLS_VERSION', '1.4.11' ); 24 24 define( 'A1TOOLS_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); 25 25 define( 'A1TOOLS_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); … … 365 365 } 366 366 add_shortcode( 'a1tools_hours', 'a1tools_shortcode_hours' ); 367 368 /** 369 * Get SVG markup for icons not available in Font Awesome 5. 370 * 371 * @since 1.4.11 372 * @param string $icon_key The SVG icon key (e.g. 'svg-x'). 373 * @return string SVG markup or empty string. 374 */ 375 function a1tools_get_svg_icon( $icon_key ) { 376 $svgs = array( 377 'svg-x' => '<svg viewBox="0 0 24 24" aria-hidden="true" fill="currentColor" class="a1tools-svg-icon"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg>', 378 ); 379 return isset( $svgs[ $icon_key ] ) ? $svgs[ $icon_key ] : ''; 380 } 381 382 /** 383 * Get icon HTML (SVG or Font Awesome <i> tag). 384 * 385 * @since 1.4.11 386 * @param string $icon Icon class or SVG key. 387 * @return string HTML markup for the icon. 388 */ 389 function a1tools_get_icon_html( $icon ) { 390 $svg = a1tools_get_svg_icon( $icon ); 391 if ( $svg ) { 392 return $svg; 393 } 394 return '<i class="' . esc_attr( $icon ) . '" aria-hidden="true"></i>'; 395 } 367 396 368 397 /** … … 402 431 'instagram_url' => array( 'label' => 'Instagram', 'icon' => 'fab fa-instagram', 'color' => '#E4405F' ), 403 432 'youtube_url' => array( 'label' => 'YouTube', 'icon' => 'fab fa-youtube', 'color' => '#FF0000' ), 404 'twitter_url' => array( 'label' => ' Twitter', 'icon' => 'fab fa-x-twitter', 'color' => '#000000' ),433 'twitter_url' => array( 'label' => 'X (Twitter)', 'icon' => 'svg-x', 'color' => '#000000' ), 405 434 'linkedin_url' => array( 'label' => 'LinkedIn', 'icon' => 'fab fa-linkedin-in', 'color' => '#0A66C2' ), 406 435 'tiktok_url' => array( 'label' => 'TikTok', 'icon' => 'fab fa-tiktok', 'color' => '#000000' ), … … 422 451 foreach ( $platforms as $key => $data ) { 423 452 if ( ! empty( $vars[ $key ] ) ) { 424 $icon _class= ! empty( $atts['icon_class'] ) ? $atts['icon_class'] : $data['icon'];453 $icon = ! empty( $atts['icon_class'] ) ? $atts['icon_class'] : $data['icon']; 425 454 $output .= '<a href="' . esc_url( $vars[ $key ] ) . '" target="_blank" rel="noopener noreferrer" title="' . esc_attr( $data['label'] ) . '">'; 426 $output .= '<i class="' . esc_attr( $icon_class ) . '" aria-hidden="true"></i>';455 $output .= a1tools_get_icon_html( $icon ); 427 456 $output .= '<span class="screen-reader-text">' . esc_html( $data['label'] ) . '</span>'; 428 457 $output .= '</a>'; … … 517 546 } 518 547 519 $icon _class= ! empty( $atts['icon_class'] ) ? $atts['icon_class'] : $data['icon'];548 $icon = ! empty( $atts['icon_class'] ) ? $atts['icon_class'] : $data['icon']; 520 549 $output .= '<a href="' . esc_url( $vars[ $key ] ) . '" class="a1tools-social-icon" target="_blank" rel="noopener noreferrer" title="' . esc_attr( $data['label'] ) . '" style="' . esc_attr( $inline_style ) . '">'; 521 $output .= '<i class="' . esc_attr( $icon_class ) . '" aria-hidden="true"></i>';550 $output .= a1tools_get_icon_html( $icon ); 522 551 $output .= '<span class="screen-reader-text">' . esc_html( $data['label'] ) . '</span>'; 523 552 $output .= '</a>'; … … 1040 1069 color: inherit; 1041 1070 line-height: 1; 1071 } 1072 .a1tools-social-icons-styled .a1tools-social-icon .a1tools-svg-icon { 1073 width: 1em; 1074 height: 1em; 1075 fill: currentColor; 1042 1076 } 1043 1077 /* Style presets for non-custom styles */ … … 1504 1538 'instagram_url' => array( 'label' => 'Instagram', 'icon' => 'fab fa-instagram', 'color' => '#E4405F' ), 1505 1539 'youtube_url' => array( 'label' => 'YouTube', 'icon' => 'fab fa-youtube', 'color' => '#FF0000' ), 1506 'twitter_url' => array( 'label' => ' Twitter', 'icon' => 'fab fa-x-twitter', 'color' => '#000000' ),1540 'twitter_url' => array( 'label' => 'X (Twitter)', 'icon' => 'svg-x', 'color' => '#000000' ), 1507 1541 'linkedin_url' => array( 'label' => 'LinkedIn', 'icon' => 'fab fa-linkedin-in', 'color' => '#0A66C2' ), 1508 1542 'tiktok_url' => array( 'label' => 'TikTok', 'icon' => 'fab fa-tiktok', 'color' => '#000000' ), … … 1640 1674 1641 1675 echo '<a href="' . esc_url( $vars[ $key ] ) . '" class="a1tools-social-icon" target="_blank" rel="noopener noreferrer" title="' . esc_attr( $data['label'] ) . '" style="' . esc_attr( $inline_style ) . '">'; 1642 echo '<i class="' . esc_attr( $data['icon'] ) . '" aria-hidden="true"></i>';1676 echo a1tools_get_icon_html( $data['icon'] ); 1643 1677 echo '<span class="screen-reader-text">' . esc_html( $data['label'] ) . '</span>'; 1644 1678 echo '</a>'; -
a1-tools/trunk/includes/class-a1-tools-elementor-widget.php
r3458218 r3462759 63 63 'instagram_url' => array( 'label' => 'Instagram', 'icon' => 'fab fa-instagram', 'color' => '#E4405F' ), 64 64 'youtube_url' => array( 'label' => 'YouTube', 'icon' => 'fab fa-youtube', 'color' => '#FF0000' ), 65 'twitter_url' => array( 'label' => ' Twitter', 'icon' => 'fab fa-x-twitter', 'color' => '#000000' ),65 'twitter_url' => array( 'label' => 'X (Twitter)', 'icon' => 'svg-x', 'color' => '#000000' ), 66 66 'linkedin_url' => array( 'label' => 'LinkedIn', 'icon' => 'fab fa-linkedin-in', 'color' => '#0A66C2' ), 67 67 'tiktok_url' => array( 'label' => 'TikTok', 'icon' => 'fab fa-tiktok', 'color' => '#000000' ), … … 503 503 } 504 504 echo '>'; 505 echo '<i class="' . esc_attr( $data['icon'] ) . '" aria-hidden="true"></i>'; 505 506 echo a1tools_get_icon_html( $data['icon'] ); 507 506 508 echo '<span class="screen-reader-text">' . esc_html( $data['label'] ) . '</span>'; 507 509 echo '</a>'; … … 525 527 $js_platforms = array(); 526 528 foreach ( $platforms as $key => $data ) { 527 $icon_parts = explode( ' ', $data['icon'] ); 528 $icon_class = end( $icon_parts ); 529 $icon_prefix = count( $icon_parts ) > 1 ? $icon_parts[0] : 'fab'; 530 531 $js_platforms[] = array( 532 'icon' => $icon_class, 533 'prefix' => $icon_prefix, 534 'color' => $data['color'], 535 'name' => $data['label'], 536 ); 529 $svg = a1tools_get_svg_icon( $data['icon'] ); 530 if ( $svg ) { 531 $js_platforms[] = array( 532 'svg' => $svg, 533 'color' => $data['color'], 534 'name' => $data['label'], 535 ); 536 } else { 537 $icon_parts = explode( ' ', $data['icon'] ); 538 $icon_class = end( $icon_parts ); 539 $icon_prefix = count( $icon_parts ) > 1 ? $icon_parts[0] : 'fab'; 540 541 $js_platforms[] = array( 542 'icon' => $icon_class, 543 'prefix' => $icon_prefix, 544 'color' => $data['color'], 545 'name' => $data['label'], 546 ); 547 } 537 548 } 538 549 … … 578 589 #> 579 590 <a href="#" class="a1tools-social-icon" style="{{ inlineStyle }}"> 591 <# if (platform.svg) { #> 592 {{{ platform.svg }}} 593 <# } else { #> 580 594 <i class="{{ platform.prefix }} {{ platform.icon }}"></i> 595 <# } #> 581 596 </a> 582 597 <# }); #> -
a1-tools/trunk/readme.txt
r3458218 r3462759 4 4 Requires at least: 5.0 5 5 Tested up to: 6.9 6 Stable tag: 1.4.1 06 Stable tag: 1.4.11 7 7 Requires PHP: 7.4 8 8 License: GPLv2 or later … … 151 151 152 152 == Changelog == 153 154 = 1.4.11 = 155 * Fixed X (Twitter) icon not displaying (fa-x-twitter is Font Awesome 6 only) 156 * Added inline SVG support for icons not available in Font Awesome 5 157 * X icon now renders as proper SVG that scales with icon size settings 153 158 154 159 = 1.4.10 =
Note: See TracChangeset
for help on using the changeset viewer.