Last active
January 15, 2017 20:40
-
-
Save patric-boehner/7c9cd399a213b650f123379fc77fdd9c to your computer and use it in GitHub Desktop.
Add an icon to Simple Social Icon
This file contains hidden or 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 | |
| //* 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; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment