Created
October 9, 2015 12:12
-
-
Save EvanHerman/1951d6879f353fd7ea04 to your computer and use it in GitHub Desktop.
Fix WP SVG Icons being overridden in the dashboard
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 | |
/* | |
* This snippet gets placed at the bottom of your active themes functions.php file | |
* - This is necessary as some themes load their own set of icons and use !important; which conflicts with our plugin | |
*/ | |
/* | |
* Fix theme's overriding the default icon set in the dashboard | |
*/ | |
add_action( 'wp_print_scripts', 'fix_wp_svg_fonts_admin_side' ); | |
function fix_wp_svg_fonts_admin_side() { | |
$screen = get_current_screen(); | |
if( isset( $screen ) && isset( $screen->base ) ) { | |
$base = $screen->base; | |
if( $base == 'toplevel_page_wp-svg-icons' ) { | |
?> | |
<style> | |
.wp-svg-iconset1-all-glyphs [data-icon]:before, | |
[data-icon]:before { | |
font-family: wp-svg-plugin-icon-set1 !important; | |
} | |
</style> | |
<?php | |
} | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment