WordPress.org

Forums

Admin Menu Editor
Special Character Added (4 posts)

  1. Son_of_the_Raven
    Member
    Posted 1 year 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 1 year 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 1 year 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 1 year 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>";
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Admin Menu Editor
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic