GeckoGrafix
4/12/2019 - 6:32 PM

New Icons In Simple Social Icons

  1. Using Font Awesome
  2. Using an SVG
//Add Simple Social Icon Code
add_filter( 'simple_social_default_profiles', 'custom_add_new_simple_icon' );
 
function custom_add_new_simple_icon( $icons ) {
	$icons['my-new-icon'] = [
		'label'   => __( 'Tripadvisor', 'simple-social-icons' ),
		'pattern' => '<li class="tripadvisor"><a href="%s" %s><i class="fa fa-tripadvisor" aria-hidden="true"></i></a></li>',
	];
 //        $icons['my-new-icon-2'] = [
	// 	'label'   => __( 'Tripadvisor', 'simple-social-icons' ),
	// 	'pattern' => '<li class="tripadvisor"><a href="%s" %s><i class="fa fa-tripadvisor" aria-hidden="true"></i></a></li>',
	// ];
 
	return $icons;
}
 
add_filter( 'simple_social_default_styles', 'custom_add_new_icon_default' );
 
function custom_add_new_icon_default( $defaults ) {
	$defaults['my-new-icon'] = '';
        // $defaults['my-new-icon-2'] = '';
 
	return $defaults;
}
//Add Simple Social Icon Code
add_filter( 'simple_social_default_profiles', 'biw_add_new_simple_icon' );
/**
 * Add Tripadvisor icon to Simple Social Icons plugin.
 *
 * @param array $icons Social icons to include in widget options.
 *
 * @return array Updated icon set.
 */
function biw_add_new_simple_icon( $icons ) {
 $icons['tripadvisor'] = [
 'label' => __( 'Tripadvisor', 'simple-social-icons' ),
 'pattern' => '<li class="social-tripadvisor"><a href="%s" %s><svg role="img" class="social-tripadvisor-svg" aria-labelledby="social-tripadvisor"><title id="social-tripadvisor">' . __( 'Tripadvisor', 'simple-social-icons' ) . '</title><use xlink:href="' . esc_url( get_stylesheet_directory_uri(__FILE__) . '/images/tripadvisor.svg#social-tripadvisor' ) . '"></use></svg></a></li>',
 ];
 return $icons;
}