patric-boehner
12/17/2016 - 6:49 AM

Add an icon to Simple Social Icon

Add an icon to Simple Social Icon

<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.

//* Loading from a custom plugin

add_filter( 'simple_social_default_profiles', 'custom_add_new_simple_icon' );
function custom_add_new_simple_icon( $icons ) {
  
  $icons['goodreads'] = [
    'label'   => __( 'Goodreads URI', 'simple-social-icons' ),
    'pattern' => '<li class="social-goodreads"><a href="%s" %s><svg role="img" class="social-goodreads" aria-labelledby="social-goodreads"><title id="social-goodreads">' . __( 'Goodreads', 'simple-social-icons' ) . '</title><use xlink:href="' . esc_url( plugin_dir_url(__FILE__) . 'svg/goodreads.svg#social-goodreads' ) . '"></use></svg></a></li>',
	];

	return $icons;
}


//* Loading from a theme

add_filter( 'simple_social_default_profiles', 'custom_add_new_simple_icon' );
function custom_add_new_simple_icon( $icons ) {
  
  $icons['goodreads'] = [
    'label' => __( 'GoodReads URI', 'simple-social-icons' ),
    'pattern' => '<li class="social-goodreads"><a href="%s" %s><svg role="img" class="social-goodreads" aria-labelledby="social-goodreads"><title id="social-goodreads">' . __( 'goodreads', 'simple-social-icons' ) . '</title><use xlink:href="' .esc_url( get_stylesheet_directory_uri() .'/svg/goodreads.svg#social-goodreads' ) . '"</use></svg></a></li>',
  ];

return $icons;
}