Created
October 10, 2022 19:05
-
-
Save yuliyang/23eca093df75ed908280a11b36a21bfe to your computer and use it in GitHub Desktop.
[ Blocksy ] Use custom social icons svg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('blocksy:social-box:dynamic-social-networks', function ($networks) { | |
$networks[] = [ | |
'id' => 'facebook', | |
'name' => __('Facebook', 'blocksy'), | |
'icon' => '<svg | |
width="20px" | |
height="20px" | |
viewBox="0 0 20 20" | |
aria-hidden="true"> | |
<path d="M10 20a10 10 0 1110-10 10 10 0 01-10 10zM10 .67A9.33 9.33 0 1019.33 10 9.33 9.33 0 0010 .67z" | |
/> | |
<path | |
d="M12.22 5h-1.48C8.85 5 8.61 6.15 8.61 7.42v.91h-.94l-.1.06-.06.1a.41.41 0 000 .11v1.67a.41.41 0 000 .11l.06.1h.1a.2.2 0 00.11 0h.83v4.16a.37.37 0 000 .11l.06.1.1.06h1.81a.21.21 0 00.24-.28v-4.07h1.39a.2.2 0 00.11 0h.1a.25.25 0 00.07-.21V8.61a.25.25 0 00-.07-.21l-.1-.06h-1.5V7.5c.06-.35.06-.3.39-.28h1c.08 0 .16 0 .22-.06A.21.21 0 0012.5 7V5.28a.37.37 0 000-.11.21.21 0 00-.06-.1L12.33 5zm-.29 1.64h-.7c-.86 0-.94.47-.94.95v1a.27.27 0 00.09.21l.1.07H11.94V10h-1.35a.29.29 0 00-.21.09.27.27 0 00-.09.21v4.16H9.17v-4.18a.28.28 0 00-.28-.3h-.83V8.91h.95l.09-.07a.26.26 0 00.07-.21V7.41c0-1.24.25-1.83 1.57-1.83h1.18v1.06z" | |
/> | |
</svg>', | |
]; | |
$networks[] = [ | |
'id' => 'twitter', | |
'name' => __('Twitter', 'blocksy'), | |
'icon' => '<svg | |
width="20px" | |
height="20px" | |
viewBox="0 0 20 20" | |
aria-hidden="true"> | |
<defs> | |
<mask id="prefix__a" x="2.37" y="4.5" width="14.96" height="11" maskUnits="userSpaceOnUse"> | |
<path | |
d="M15 6.51a2.09 2.09 0 00.17-.41.34.34 0 000-.2.34.34 0 00-.17-.17.33.33 0 00-.39 0 3.69 3.69 0 01-1 .43 2.49 2.49 0 00-1.64-.63 2.47 2.47 0 00-1.76.75 2.33 2.33 0 00-.52.83 2.4 2.4 0 00-.16 1A5.66 5.66 0 015.82 6a.41.41 0 00-.13-.1.45.45 0 00-.16 0 .44.44 0 00-.16.06.57.57 0 00-.11.11 2.47 2.47 0 00-.33 1.19 2.36 2.36 0 00.29 1.19l-.14.05a.41.41 0 00-.08.12.34.34 0 000 .17 2.44 2.44 0 00.85 1.85.4.4 0 00-.08.16.5.5 0 000 .17 2.42 2.42 0 001.4 1.51 3.89 3.89 0 01-2.18.37.37.37 0 00-.22.06.39.39 0 00-.14.17.3.3 0 000 .23.29.29 0 00.14.17 6.31 6.31 0 009.72-5.32v-.1a4.7 4.7 0 001-1.06.39.39 0 00.06-.21.32.32 0 00-.08-.2.32.32 0 00-.18-.12.37.37 0 00-.29.04zm-1.17 1.12a.45.45 0 00-.11.13.32.32 0 000 .17v.25a5.61 5.61 0 01-7.51 5.32 4.45 4.45 0 002-.89.3.3 0 00.12-.17.28.28 0 000-.2.3.3 0 00-.12-.17A.4.4 0 008 12a1.66 1.66 0 01-.79-.2 1.7 1.7 0 01-.62-.54 2.53 2.53 0 00.41-.08.29.29 0 00.18-.13.31.31 0 00.07-.21.32.32 0 00-.08-.21.31.31 0 00-.17-.11A1.78 1.78 0 015.67 9.3a3.09 3.09 0 00.52.07.35.35 0 00.34-.24.34.34 0 00-.14-.39 1.72 1.72 0 01-.66-.82 1.83 1.83 0 01-.07-1.06 6.31 6.31 0 004.2 1.9.34.34 0 00.28-.12.32.32 0 00.07-.3 1.79 1.79 0 01.89-1.95 1.78 1.78 0 011.11-.18 1.75 1.75 0 011 .53.42.42 0 00.14.09.37.37 0 00.18 0l.31-.07-.15.09a.49.49 0 00-.14.18.3.3 0 000 .23.34.34 0 00.36.23h.12c-.03.04-.13.1-.2.14z" | |
fill="#fff" /> | |
</mask> | |
</defs> | |
<path d="M10 20a10 10 0 1110-10 10 10 0 01-10 10zM10 .67A9.33 9.33 0 1019.33 10 9.33 9.33 0 0010 .67z" | |
/> | |
<g mask="url(#prefix__a)"> | |
<path | |
d="M15 6.51a2.09 2.09 0 00.17-.41.34.34 0 000-.2.34.34 0 00-.17-.17.33.33 0 00-.39 0 3.69 3.69 0 01-1 .43 2.49 2.49 0 00-1.64-.63 2.47 2.47 0 00-1.76.75 2.33 2.33 0 00-.52.83 2.4 2.4 0 00-.16 1A5.66 5.66 0 015.82 6a.41.41 0 00-.13-.1.45.45 0 00-.16 0 .44.44 0 00-.16.06.57.57 0 00-.11.11 2.47 2.47 0 00-.33 1.19 2.36 2.36 0 00.29 1.19l-.14.05a.41.41 0 00-.08.12.34.34 0 000 .17 2.44 2.44 0 00.85 1.85h0a.4.4 0 00-.08.16.5.5 0 000 .17 2.42 2.42 0 001.4 1.51 3.89 3.89 0 01-2.18.37.37.37 0 00-.22.06.39.39 0 00-.14.17.3.3 0 000 .23.29.29 0 00.14.17 6.31 6.31 0 009.72-5.32v-.1a4.7 4.7 0 001-1.06.39.39 0 00.06-.21.32.32 0 00-.08-.2.32.32 0 00-.18-.12.37.37 0 00-.29.04zm-1.17 1.12a.45.45 0 00-.11.13.32.32 0 000 .17v.25a5.61 5.61 0 01-7.51 5.32 4.45 4.45 0 002-.89.3.3 0 00.12-.17.28.28 0 000-.2.3.3 0 00-.12-.17A.4.4 0 008 12a1.66 1.66 0 01-.79-.2 1.7 1.7 0 01-.62-.54 2.53 2.53 0 00.41-.08.29.29 0 00.18-.13.31.31 0 00.07-.21.32.32 0 00-.08-.21.31.31 0 00-.17-.11A1.78 1.78 0 015.67 9.3a3.09 3.09 0 00.52.07.35.35 0 00.34-.24.34.34 0 00-.14-.39 1.72 1.72 0 01-.66-.82 1.83 1.83 0 01-.07-1.06 6.31 6.31 0 004.2 1.9.34.34 0 00.28-.12.32.32 0 00.07-.3 1.79 1.79 0 01.89-1.95 1.78 1.78 0 011.11-.18 1.75 1.75 0 011 .53.42.42 0 00.14.09.37.37 0 00.18 0l.31-.07-.15.09a.49.49 0 00-.14.18.3.3 0 000 .23.34.34 0 00.36.23h.12c-.03.04-.13.1-.2.14z" | |
stroke-width="2" /> | |
</g> | |
</svg>', | |
]; | |
return $networks; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment