Skip to content

Instantly share code, notes, and snippets.

@jomurgel
Created February 14, 2019 21:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jomurgel/ddf5a916ab8ac61cf880268dc28f9271 to your computer and use it in GitHub Desktop.
Save jomurgel/ddf5a916ab8ac61cf880268dc28f9271 to your computer and use it in GitHub Desktop.
Add social icon to Acorn Theme social icon array
<?php
/**
* Add custom icon to social media support.
*
* @param array $social_icons array of social icons.
* @return array new social icons array.
*/
function add_social_icon( $social_icons ) {
$custom_icons = array(
'apple' => '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 384.1" xml:space="preserve"><title>' . __( 'Apple', 'acorn-theme' ) . '</title><path d="M237.6,89.9c-33.6,0-47.8,16.5-71.2,16.5c-24,0-42.3-16.4-71.4-16.4c-28.5,0-58.9,17.9-78.2,48.4c-27.1,43-22.5,124,21.4,193c15.7,24.7,36.7,52.4,64.2,52.7c0.2,0,0.3,0,0.5,0c23.9,0,31-16.1,63.9-16.3c0.2,0,0.3,0,0.5,0c32.4,0,38.9,16.2,62.7,16.2c0.2,0,0.3,0,0.5,0c27.5-0.3,49.6-31,65.3-55.6c11.3-17.7,15.5-26.6,24.2-46.6c-63.5-24.8-73.7-117.4-10.9-152.9C289.9,104.2,263,89.9,237.6,89.9L237.6,89.9z M230.2,0c-20,1.4-43.3,14.5-57,31.6c-12.4,15.5-22.6,38.5-18.6,60.8c0.5,0,1,0,1.6,0c21.3,0,43.1-13.2,55.8-30.1C224.3,46.2,233.6,23.4,230.2,0L230.2,0z"/></svg>',
);
return wp_parse_args( $custom_icons, $social_icons );
}
add_filter( 'social_icons', 'AcornTheme\Functions\add_social_icon', 10, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment