Instantly share code, notes, and snippets.

Embed
What would you like to do?
[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