Skip to content

Instantly share code, notes, and snippets.

@EvanHerman
Created October 9, 2015 12:12
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 EvanHerman/1951d6879f353fd7ea04 to your computer and use it in GitHub Desktop.
Save EvanHerman/1951d6879f353fd7ea04 to your computer and use it in GitHub Desktop.
Fix WP SVG Icons being overridden in the dashboard
<?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