Skip to content

Commit a6cd712

Browse files
authored
Merge pull request #401 from awesomemotive/issue/396-add-support-for-xcom-threads
Add support for x.com & threads in social media icons
2 parents f233d32 + 330552b commit a6cd712

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

inc/classes/class-botiga-svg-icons.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ public static function get_svg_icon( $icon ) {
2020
}
2121

2222
public static $svg_icons = array(
23+
'icon-x.com' => '<svg class="w-6 h-6 text-gray-800 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 24 24">
24+
<path d="M13.795 10.533 20.68 2h-3.073l-5.255 6.517L7.69 2H1l7.806 10.91L1.47 22h3.074l5.705-7.07L15.31 22H22l-8.205-11.467Zm-2.38 2.95L9.97 11.464 4.36 3.627h2.31l4.528 6.317 1.443 2.02 6.018 8.409h-2.31l-4.934-6.89Z"/>
25+
</svg>',
26+
'icon-threads' => '<svg width="16" height="16" viewBox="-.1 .2 481.2 555.9" xmlns="http://www.w3.org/2000/svg"><path d="m182 3.4c-34.4 7.7-66.1 22.2-90.1 41.1-11.7 9.3-28.9 27.1-38.3 39.8-4.7 6.4-8.6 11.9-8.6 12.2 0 .4-1.3 2.5-2.9 4.8-3.7 5.4-12.8 23.6-17.6 35.2-3.4 8.2-5.4 14.1-11.4 33.7-2.6 8.3-7.6 33.4-9.2 45.3-.6 4.9-1.6 11.9-2.1 15.5s-1.2 22.5-1.5 42.1c-.4 33.8-.3 36.5 2.1 56 1.4 11.2 3.5 25.3 4.6 31.4 2.1 11.3 8.9 37.6 11.7 44.9 15.8 41.8 30.4 65.8 55.3 90.7 18.1 18.2 32.6 28.5 55.5 39.5 15.8 7.7 35.7 14.4 52.6 17.9l12.5 2.6 55-.4c54.8-.4 54.9-.4 64.9-2.9 39.9-10.1 70.1-27.1 98-55.2 16.8-16.9 28.4-34.5 36.3-55 7.2-18.6 9.1-28 9.9-48.6 2.4-60.7-26.2-108.1-81.3-135-4.5-2.2-8.4-4.7-8.7-5.5-.4-.8-.9-4.9-1.2-9.2-1-12.3-4.9-29.9-9.5-42.5-9.9-27.2-29.7-49.9-53-61-15.5-7.3-26.9-10.3-46.2-11.8-18.2-1.5-34.4 0-52.8 4.8-7.3 1.9-21.8 8.9-30.4 14.6-12.7 8.4-31.6 27.9-31.6 32.4 0 .7 32.5 23.6 37.7 26.6.6.3 4.8-3.1 10-8.2 11.1-11 17.5-14.6 34.8-19.3 7.8-2.2 33.2-1.9 42 .4 26.5 7 41.2 23 48 52.4 1.1 4.6 1.1 5.5-.2 6-.8.3-6.4-.1-12.6-.8-14.1-1.8-58-1.8-69.2-.1-33.9 5.3-59.3 17.9-77.2 38.5-23.8 27.3-27 70.8-7.6 102.9 5.3 8.8 17.7 21.9 25.7 27.2 23.4 15.5 51.8 22.3 81.5 19.6 55.3-5.1 91.2-37.7 105.1-95.5 1.2-4.9 2.4-11.1 2.7-13.7.9-7.5 2.2-7.8 10-2 22.4 16.6 34.3 39.3 35.9 68.2 1.9 33.1-14.1 65.6-44.4 90.3-23.1 18.9-45.6 28.5-80.3 34.4-15.2 2.6-63.8 2.6-79.4 0-42.3-7.1-74.5-22.6-99.2-47.8-14.1-14.6-22.6-26.6-32-45.4-8.3-16.5-16.6-42.7-21.2-66.5-4.5-23.7-6.5-50.9-5.8-78.5.9-33.2 3.5-52.5 10.8-82.2 7.1-29.1 20.8-57.8 36.7-77.4 15.3-18.9 31.8-32.1 53.7-42.8 13.7-6.7 18.3-8.5 29.5-11.5 3-.8 8-2.1 11-2.9 8.5-2.3 25-4.6 40.7-5.7 22.6-1.5 53.3 1.1 71.8 6.1 2.2.5 5.6 1.4 7.5 1.8 8.1 1.8 23 7.5 34.4 13.1 26.3 13.1 47.7 32.2 64.1 57.3 5.7 8.8 16.5 29.7 16.5 31.9 0 .8.4 1.8.9 2.3 1.1 1.3 5.5 13.2 7.6 20.7.9 3.2 2 6 2.5 6.3.8.5 17.3-3.6 36-8.8l8.5-2.4.3-3.6c.3-3.6-5.5-22.6-10-32.5-20-44.8-41-72.3-74.8-97.9-21.6-16.3-53.9-30.5-85.5-37.6l-14-3.1-50-.2-50-.2zm112 283.6c15.7 2 22.5 3.3 23.6 4.7 2 2.3-.9 22.4-5 35.4-8.3 25.9-22.4 40.7-45.1 47-11.5 3.2-33.6 3.2-45 0-25.3-7-39.2-24.8-36.3-46.3 1.9-14 10.6-24.7 26-32.2 9.8-4.8 14.1-6 27.8-8.1 10.6-1.6 42.6-1.9 54-.5z"/></svg>',
2327
'icon-phone' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M497.39 361.8l-112-48a24 24 0 0 0-28 6.9l-49.6 60.6A370.66 370.66 0 0 1 130.6 204.11l60.6-49.6a23.94 23.94 0 0 0 6.9-28l-48-112A24.16 24.16 0 0 0 122.6.61l-104 24A24 24 0 0 0 0 48c0 256.5 207.9 464 464 464a24 24 0 0 0 23.4-18.6l24-104a24.29 24.29 0 0 0-14.01-27.6z"/></svg>',
2428
'icon-phone2' => '<svg viewBox="0 0 15 15" xmlns="http://www.w3.org/2000/svg">
2529
<path d="M13.125 9.52734L10.4453 8.37891C9.84375 8.10547 9.16016 8.29688 8.75 8.78906L8.01172 9.69141C6.78125 8.98047 5.76953 7.96875 5.05859 6.76562L5.98828 6.02734C6.45312 5.61719 6.64453 4.93359 6.39844 4.35938L5.22266 1.625C4.94922 0.996094 4.26562 0.640625 3.58203 0.804688L1.09375 1.37891C0.4375 1.51562 0 2.08984 0 2.77344C0 9.39062 5.35938 14.75 11.9766 14.75C12.6602 14.75 13.2344 14.3125 13.3438 13.6562L13.918 11.168C14.1094 10.4844 13.7539 9.80078 13.125 9.52734ZM12.6602 10.8672L12.0859 13.3555C12.0859 13.3828 12.0312 13.4375 11.9766 13.4375C6.09766 13.4375 1.28516 8.65234 1.28516 2.77344C1.28516 2.71875 1.33984 2.66406 1.39453 2.66406L3.88281 2.08984L3.91016 2.0625C3.96484 2.0625 3.99219 2.11719 4.01953 2.14453L5.16797 4.82422C5.19531 4.87891 5.19531 4.93359 5.14062 4.96094L3.80078 6.05469C3.58203 6.24609 3.5 6.57422 3.63672 6.84766C4.53906 8.67969 6.04297 10.1836 7.875 11.0859C8.14844 11.2227 8.50391 11.168 8.69531 10.9219L9.78906 9.58203C9.81641 9.55469 9.87109 9.52734 9.92578 9.55469L12.6055 10.7031C12.6602 10.7578 12.6875 10.8125 12.6602 10.8672Z" fill="white"/>

inc/template-functions.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -367,16 +367,12 @@ function botiga_page_options() {
367367
*/
368368
function botiga_get_social_network( $social ) {
369369

370-
$networks = array( 'facebook', 'twitter', 'x.com', 'instagram', 'github', 'linkedin', 'youtube', 'xing', 'flickr', 'dribbble', 'vk', 'weibo', 'vimeo', 'mix', 'behance', 'spotify', 'soundcloud', 'twitch', 'bandcamp', 'etsy', 'pinterest', 'tiktok', 'discord', 'xiaohongshu' );
370+
$networks = array( 'facebook', 'twitter', 'x.com', 'threads', 'instagram', 'github', 'linkedin', 'youtube', 'xing', 'flickr', 'dribbble', 'vk', 'weibo', 'vimeo', 'mix', 'behance', 'spotify', 'soundcloud', 'twitch', 'bandcamp', 'etsy', 'pinterest', 'tiktok', 'discord', 'xiaohongshu' );
371371

372372
foreach ( $networks as $network ) {
373373
$found = strpos( $social, $network );
374374

375375
if ( $found !== false ) {
376-
if ( $network === 'x.com' ) {
377-
return 'twitter';
378-
}
379-
380376
return $network;
381377
}
382378
}

0 commit comments

Comments
 (0)