-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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