update fontawesome integration and add kit support

This commit is contained in:
2026-02-10 15:22:19 +00:00
parent d892714026
commit 449ebe65bb
10 changed files with 621 additions and 13886 deletions

View File

@@ -108,9 +108,7 @@ class Dynamic
'0' => '<i class="fa-solid"></i> <span>Please select an icon</span>', '0' => '<i class="fa-solid"></i> <span>Please select an icon</span>',
]; ];
foreach($icons as $slug => $props): foreach($icons as $slug):
if(in_array($slug, range(0,9))) continue;
$choices[$slug] = '<i class="fa-'.$set.' fa-'.$slug.'" style="color: #2271b1;"></i> <span>' . (ucwords(str_replace('-', ' ', $slug))) . '</span>'; $choices[$slug] = '<i class="fa-'.$set.' fa-'.$slug.'" style="color: #2271b1;"></i> <span>' . (ucwords(str_replace('-', ' ', $slug))) . '</span>';
endforeach; endforeach;

View File

@@ -13,9 +13,9 @@ class Enqueue
{ {
wp_enqueue_style( wp_enqueue_style(
'fontawesome', 'fontawesome',
'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css', 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/7.0.1/css/all.min.css',
false, false,
'6.5.2', '7.0.1',
'all' 'all'
); );
} }

View File

@@ -7,6 +7,7 @@ class Integrations
public function __construct() public function __construct()
{ {
add_action( 'wp_head', [$this, 'FathomAnalytics']); add_action( 'wp_head', [$this, 'FathomAnalytics']);
add_action( 'wp_footer', [$this, 'FontAwesomeKit'], 100);
} }
public function FathomAnalytics() public function FathomAnalytics()
@@ -21,4 +22,17 @@ class Integrations
<?php endif; <?php endif;
} }
public function FontAwesomeKit()
{
$kit = get_field('badegg_integrations_fontawesome_kit', 'option');
if($kit): ?>
<!-- FontAwesome Kit -->
<script src="https://kit.fontawesome.com/<?= $kit ?>.js" crossorigin="anonymous"></script>
<!-- / FontAwesome Kit -->
<?php endif;
}
} }

View File

@@ -17,7 +17,8 @@
"id": "" "id": ""
}, },
"placement": "top", "placement": "top",
"endpoint": 0 "endpoint": 0,
"selected": 0
}, },
{ {
"key": "field_67658e49aba4f", "key": "field_67658e49aba4f",
@@ -58,7 +59,10 @@
"default_value": "", "default_value": "",
"enable_opacity": 0, "enable_opacity": 0,
"return_format": "string", "return_format": "string",
"parent_repeater": "field_67658e49aba4f" "parent_repeater": "field_67658e49aba4f",
"custom_palette_source": "",
"palette_colors": "",
"show_color_wheel": true
}, },
{ {
"key": "field_67658fba41889", "key": "field_67658fba41889",
@@ -167,6 +171,7 @@
"id": "" "id": ""
}, },
"layout": "block", "layout": "block",
"parent_repeater": "field_67658e49aba4f",
"sub_fields": [ "sub_fields": [
{ {
"key": "field_676590414188c", "key": "field_676590414188c",
@@ -184,7 +189,10 @@
}, },
"default_value": "", "default_value": "",
"enable_opacity": 0, "enable_opacity": 0,
"return_format": "string" "return_format": "string",
"custom_palette_source": "",
"palette_colors": "",
"show_color_wheel": true
}, },
{ {
"key": "field_676590684188d", "key": "field_676590684188d",
@@ -202,7 +210,10 @@
}, },
"default_value": "", "default_value": "",
"enable_opacity": 0, "enable_opacity": 0,
"return_format": "string" "return_format": "string",
"custom_palette_source": "",
"palette_colors": "",
"show_color_wheel": true
}, },
{ {
"key": "field_6765907f4188e", "key": "field_6765907f4188e",
@@ -220,7 +231,10 @@
}, },
"default_value": "", "default_value": "",
"enable_opacity": 0, "enable_opacity": 0,
"return_format": "string" "return_format": "string",
"custom_palette_source": "",
"palette_colors": "",
"show_color_wheel": true
}, },
{ {
"key": "field_676590924188f", "key": "field_676590924188f",
@@ -238,7 +252,10 @@
}, },
"default_value": "", "default_value": "",
"enable_opacity": 0, "enable_opacity": 0,
"return_format": "string" "return_format": "string",
"custom_palette_source": "",
"palette_colors": "",
"show_color_wheel": true
}, },
{ {
"key": "field_6765909941890", "key": "field_6765909941890",
@@ -256,7 +273,10 @@
}, },
"default_value": "", "default_value": "",
"enable_opacity": 0, "enable_opacity": 0,
"return_format": "string" "return_format": "string",
"custom_palette_source": "",
"palette_colors": "",
"show_color_wheel": true
}, },
{ {
"key": "field_6765909f41891", "key": "field_6765909f41891",
@@ -274,10 +294,12 @@
}, },
"default_value": "", "default_value": "",
"enable_opacity": 0, "enable_opacity": 0,
"return_format": "string" "return_format": "string",
"custom_palette_source": "",
"palette_colors": "",
"show_color_wheel": true
} }
], ]
"parent_repeater": "field_67658e49aba4f"
} }
] ]
}, },
@@ -296,7 +318,8 @@
"id": "" "id": ""
}, },
"placement": "top", "placement": "top",
"endpoint": 0 "endpoint": 0,
"selected": 0
}, },
{ {
"key": "field_67659cb08081e", "key": "field_67659cb08081e",
@@ -372,7 +395,8 @@
"id": "" "id": ""
}, },
"placement": "top", "placement": "top",
"endpoint": 0 "endpoint": 0,
"selected": 0
}, },
{ {
"key": "field_676594615ead2", "key": "field_676594615ead2",
@@ -393,6 +417,27 @@
"placeholder": "", "placeholder": "",
"prepend": "", "prepend": "",
"append": "" "append": ""
},
{
"key": "field_698b36010d055",
"label": "Font Awesome Kit ID",
"name": "badegg_integrations_fontawesome_kit",
"aria-label": "",
"type": "text",
"instructions": "The internet's icon library + toolkit. Used by millions of designers, devs, & content creators. Open-source. Always free. Always awesome. <a href=\"https:\/\/fontawesome.com\/\" target=\"_blank\" rel=\"noopener nofollow noindex\">Visit website<\/a>",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": "",
"maxlength": "",
"allow_in_bindings": 1,
"placeholder": "",
"prepend": "",
"append": ""
} }
], ],
"location": [ "location": [
@@ -413,5 +458,6 @@
"active": true, "active": true,
"description": "", "description": "",
"show_in_rest": 0, "show_in_rest": 0,
"modified": 1734712625 "display_title": "",
"modified": 1770736471
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -1,12 +1,10 @@
<ul class="socials nolist"> <ul class="socials nolist">
@foreach($socials as $social) @foreach($socials as $social)
<li> <li>
<a <a href="{{ get_field('url', $social) }}" rel="noopener nofollow noreferrer" target="_blank">
class="fa-brands fa-{{ get_field('fontawesome_brands', $social) }}" <i class="fa-brands fa-{{ get_field('fontawesome_brands', $social) }}"></i>
href="{{ get_field('url', $social) }}" <span class="visually-hidden">{{ get_the_title($social) }}</span>
rel="noopener nofollow noreferrer" </a>
target="_blank"
><span class="visually-hidden">{{ get_the_title($social) }}</span></a>
</li> </li>
@endforeach @endforeach
</ul> </ul>

View File

@@ -1,3 +1,4 @@
<footer class="content-info"> <footer class="content-info">
@php(dynamic_sidebar('sidebar-footer')) @php(dynamic_sidebar('sidebar-footer'))
@include('components.socials')
</footer> </footer>