Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@glueckpress
Forked from krafit/wpseo-iconfix.php
Last active October 2, 2018 23:12
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save glueckpress/596260cc2ce7ab9f9ac9 to your computer and use it in GitHub Desktop.
Save glueckpress/596260cc2ce7ab9f9ac9 to your computer and use it in GitHub Desktop.
[WordPress] Nachdem der Schmerz, den wpSEO-Menüpunkt ansehen zu müssen zu groß wurde, hat @krafit das Icon im Admin-Menü ersetzt. Ich hab’s in ein Plugin gewickelt, Torsten hat’s aktualisiert.
<?php
/**
* Plugin Name: wpSEO Icon Fix
* Description: Admin icon hack for wpSEO.
* Version: 2018.08
* Author: Simon Kraft, Caspar Hübinger, Torsten Landsiedel
* License: GNU General Public License v3
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Load plugin.
*/
function krafit_repair_wpseo() {
if ( ! function_exists( 'wpseode_autoload' ) ) {
return;
}
// https://developer.wordpress.org/resource/dashicons/#chart-area
add_action( 'admin_head', function () {
?>
<style>
#adminmenu #toplevel_page_wpseode div.wp-menu-image img {
display: none;
}
#adminmenu #toplevel_page_wpseode div.wp-menu-image::before {
content: "\f239";
}
</style>
<?php
});
}
add_action( 'plugins_loaded', 'krafit_repair_wpseo' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment