Skip to content

Commit 0ed1b66

Browse files
committed
Add Bluesky social icon support to theme
Directly modifies the TwentyNineteen SVG Icons class to add Bluesky to the social icons map and provides the SVG markup for the Bluesky icon. Replaces previous filter-based approach with a single function hooked to 'after_setup_theme'.
1 parent c7d868c commit 0ed1b66

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

functions.php

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -103,24 +103,18 @@ function externalLinkIcon() {
103103
add_action( 'wp_enqueue_scripts', 'ace_add_external_link_icon' );
104104

105105
// Add Social Link Icons for Bluesky
106+
// Directly modify the TwentyNineteen SVG Icons class to add Bluesky support
107+
function c4aa_add_bluesky_icon() {
108+
// Add Bluesky to the social icons map
109+
TwentyNineteen_SVG_Icons::$social_icons_map['bluesky'] = array('bsky.app');
106110

107-
// Add Bluesky to the social icons map
108-
function add_bluesky_social_icon( $social_icons_map ) {
109-
$social_icons_map['bluesky'] = array('bsky.app');
110-
return $social_icons_map;
111-
}
112-
add_filter( 'twentynineteen_social_icons_map', 'add_bluesky_social_icon', 5 );
113-
114-
// Add the actual SVG content for Bluesky
115-
function add_bluesky_svg_icon( $social_icons ) {
116-
$social_icons['bluesky'] = '
111+
// Add the Bluesky SVG icon
112+
TwentyNineteen_SVG_Icons::$social_icons['bluesky'] = '
117113
<svg viewBox="0 0 600 530" version="1.1" xmlns="http://www.w3.org/2000/svg">
118114
<path d="m135.72 44.03c66.496 49.921 138.02 151.14 164.28 205.46 26.262-54.316 97.782-155.54 164.28-205.46 47.98-36.021 125.72-63.892 125.72 24.795 0 17.712-10.155 148.79-16.111 170.07-20.703 73.984-96.144 92.854-163.25 81.433 117.3 19.964 147.14 86.092 82.697 152.22-122.39 125.59-175.91-31.511-189.63-71.766-2.514-7.3797-3.6904-10.832-3.7077-7.8964-0.0174-2.9357-1.1937 0.51669-3.7077 7.8964-13.714 40.255-67.233 197.36-189.63 71.766-64.444-66.128-34.605-132.26 82.697-152.22-67.108 11.421-142.55-7.4491-163.25-81.433-5.9562-21.282-16.111-152.36-16.111-170.07 0-88.687 77.742-60.816 125.72-24.795z" />
119115
</svg>';
120-
121-
return $social_icons;
122116
}
123-
add_filter( 'twentynineteen_social_icons', 'add_bluesky_svg_icon', 5 );
117+
add_action( 'after_setup_theme', 'c4aa_add_bluesky_icon' );
124118
/**
125119
* ACF Body Class Options
126120
*

0 commit comments

Comments
 (0)