WordPress.org

Ready to get started?Download WordPress

Forums

Admin Menu Editor
Special Character Added (4 posts)

  1. Son_of_the_Raven
    Member
    Posted 4 months ago #

    When I use a Font Awesome character as the icon for a menu item, I get a box with an X in it next to the icon when I use IE 10 or IE 11. When I look at the source code, it shows a br / HTML tag inside the div that has the class for the font-awesome icon.

    <div class='wp-menu-image dashicons dashicons-businessman'><br /></div>

    I can cut and paste the HTML into a test HTML file, remove the br tag and that character goes away. Its presence does not impact functionality but I have a rather picky client that would not want to see that there.

    https://wordpress.org/plugins/admin-menu-editor/

  2. Janis Elsts
    Member
    Plugin Author

    Posted 4 months ago #

    This issue is not related to Admin Menu Editor. Even if you deactivate the plugin, Dashicons menu icons still have the same problem.

    It's easy to reproduce by adding the following snippet to functions.php or a mini-plugin:

    function ws_add_test_menu() {
    	add_menu_page(
    		'Test',
    		'Test',
    		'read',
    		'ws-test-page',
    		'__return_null',
    		'dashicons-businessman'
    	);
    }
    add_action('admin_menu', 'ws_add_test_menu');

    By the way, it's Dashicons, not Font Awesome.

  3. Son_of_the_Raven
    Member
    Posted 4 months ago #

    Realized my mistake after I hit send. I understand that the issue witb the font would exist regardless of how they are entered but my point was that it is only happening with icons I changed through this plugin. Hence, my suspicion that this plugin is adding those characters.

  4. rtpdev
    Member
    Posted 3 months ago #

    Hey guys. This is a really easy fix. Raven, just add this to functions.php or a custom plugin:

    add_action( 'admin_head', 'hideThoseBuggers' );
    function hideThoseBuggers() {
        echo "<style type='text/css'>.dashicons br { display:none; }</style>";
    }

Reply

You must log in to post.

About this Plugin

About this Topic