Create a gist now

Instantly share code, notes, and snippets.

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. Enthält eine Closure, deshalb ab PHP 5.3.
<?php
/**
* Plugin Name: wpSEO Icon Fix
* Description: Admin icon hack for wpSEO.
* Version: 2015.12
* Author: Simon Kraft, Caspar Hübinger
* 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( 'wpseo_autoload' ) )
return;
// https://developer.wordpress.org/resource/dashicons/#carrot
add_action( 'admin_head', function () {
?>
<style>
#adminmenu #toplevel_page_wpseo div.wp-menu-image img {
display: none;
}
#adminmenu #toplevel_page_wpseo div.wp-menu-image::before {
content: "\f511";
}
</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