Skip to content

Instantly share code, notes, and snippets.

@Zodiac1978
Forked from glueckpress/wpseo-iconfix.php
Last active August 24, 2018 12:56
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 Zodiac1978/81ecd1b3c53c5643c506594d4871c73c to your computer and use it in GitHub Desktop.
Save Zodiac1978/81ecd1b3c53c5643c506594d4871c73c 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. Enthält eine Closure, deshalb ab PHP 5.3. Erfordert kleinere Anpassungen nach dem Update (https://wpseo.de/verlauf/) auf 4.5.
<?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