Icons are not displayed in the side menu
-
First sorry for my bad english. Icons for newly created menus are not displayed in the side admin menu if non-English language is used.
Maybe you should consider using ‘slug’ for menu detection, or if you’re going to continue using titles for detection, then you should use the ‘ecs_html__’ function for the original titles.
I solved the correct display of the icons by using the ‘esc_html__’ function to correctly match the titles and the icon names.foreach ( $custom_icons as $custom_icon ) {
if ( $title && strpos( $title, $custom_icon ) !== false ) {
$icon = '<img src="' . plugins_url( 'icons/' . strtolower( $custom_icon ) . '.svg', __FILE__ ) . '" width="15" height="18">';
break;
}foreach ( $custom_icons as $custom_icon ) {
$translated_custom_icon = esc_html__( $custom_icon, 'woocommerce' );
if ( $title && strpos( $title, $translated_custom_icon ) !== false ) {
$icon = '<img src="' . plugins_url( 'icons/' . strtolower( $custom_icon ) . '.svg', __FILE__ ) . '" width="15" height="18">';
break;
}
}
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Icons are not displayed in the side menu’ is closed to new replies.