WordPress.org

Ready to get started?Download WordPress

Forums

Ozh' Admin Drop Down Menu
Menu Icons Missing - WP 3.9 (21 posts)

  1. GR8FL
    Member
    Posted 4 months ago #

    Menu icons are missing. Otherwise works. I really prefer this dropdown on top rather than WordPress default on the left. How can this be fixed?

    https://wordpress.org/plugins/ozh-admin-drop-down-menu/

  2. davidquay231
    Member
    Posted 4 months ago #

    Ditto to this ... seems to be 3.9 specific

  3. Kelli Standish
    Member
    Posted 4 months ago #

    Same here. Would love to find a way to fix this.

  4. Kelli Standish
    Member
    Posted 4 months ago #

    A couple notes in case this helps anyone else:

    I tried the fix listed here for 3.8, but it didn't work for me.

    So as a temporary fix, just to get rid of the hideous broken image icons in my client's menu bar, I went here: /wp-admin/options-general.php?page=ozh_admin_menu

    And unchecked the "Display original icons" box. Now there are no icons, but at least that hides the broken image icons :)

  5. GR8FL
    Member
    Posted 4 months ago #

    What's weird is that some icons have come back while others haven't.

    The icons restored are plugin ones such as Quick Cache, Shareaholic, WordPress SEO (Yoast), Meteor Slides. The WordPress ones have not.

  6. spherical
    Member
    Posted 3 months ago #

    3.9 now uses a font called Dashicons. There are no image files to access anymore, so this will require a rewrite to the plugin code.

  7. ETMSOFT
    Member
    Posted 3 months ago #

    Hi there, a temporary solution I found is:

    - disable sublevel icons in Settings/Admin menu

    - in plugin's file inc/core.php, wrap lines from 82 to 89 within an IF that disables icons:

    if ($wp_ozh_adminmenu['wpicons']) {
    	$imgstyle = ($wp_ozh_adminmenu['wpicons']) ? '' : 'style="display:none"';
    	$img = '';
    	if ( isset($item[6]) && ! empty($item[6]) ) {
    		if ( 'none' === $item[6] || 'div' === $item[6] )
    			$img = '<div '.$imgstyle.' class="wp-menu-image"><br /></div>';
    		else
    			$img = '<img '.$imgstyle.' class="wp-menu-image" src="' . $item[6] . '" alt="" />';
    	}
    }

    hope this help

  8. Jackie
    Member
    Posted 3 months ago #

    Even if your disable icon portion of the plugin, the server throws all these 404 errors. My server seems to think its worthy of a level 10 security mention

  9. Muhammad Mahmoud
    Member
    Posted 2 months ago #

    hello all

    this is a temporary solution that will display the new Dashicons set instead of empty icons

    - open the plugin directory and edit the file in that path inc/core.php , starting from line 85 you will find this part of code

    if ( isset($item[6]) && ! empty($item[6]) ) {
    			if ( 'none' === $item[6] || 'div' === $item[6] )
    				$img = '<div '.$imgstyle.' class="wp-menu-image"><br /></div>';
    			else
    				$img = '<img '.$imgstyle.' class="wp-menu-image" src="' . $item[6] . '" alt="" />';
    		}

    just replace it with the following code

    if ( isset($item[6]) && ! empty($item[6]) ) {
    			preg_match('/^dashicons/', $item[6], $matches);
    			if ( 'none' === $item[6] || 'div' === $item[6] )
    				$img = '<div '.$imgstyle.' class="wp-menu-image"><br /></div>';
    			elseif (!empty($matches))
    				$img = '<div '.$imgstyle.' class="wp-menu-image dashicons-before '.$item[6].'"><br /></div>';
    			else
    				$img = '<img '.$imgstyle.' class="wp-menu-image" src="' . $item[6] . '" alt="" />';
    		}

    i tried to keep the orginal code of the plugin away of modifications , i just added a new condition that look for "dashicons" and then it will alter the div classes with the needed icon class

    hope this help

  10. GR8FL
    Member
    Posted 2 months ago #

    @Muhammad Mahmoud - outstanding!!

    the file name is ozh-admin-drop-down-menu/inc/core.php - was a bit confused at first which one.

    thank you!

  11. spherical
    Member
    Posted 2 months ago #

    Tried the above code and, while the dashicons font shows up, there are two of them; one white that is overlaid by another that is grey and offset down and to the left.

    Changing the class from dashicons-before to dashicons-after clears the overlay.

  12. Muhammad Mahmoud
    Member
    Posted 2 months ago #

    @spherical
    that's weird ! , i got the class name from the native wordpress styling for menu items
    if you have a normal dashboard without Ozh plugin and inspected the menu items code you will find that wordpress uses class "dashicons-before" !

  13. Faisal Humayun
    Member
    Posted 2 months ago #

    @ Br. Muhammad - Your code worked perfectly fine for my installation of wordpress. Jzk!

  14. Ozh
    Member
    Plugin Author

    Posted 2 months ago #

    Peeps, the plugin is hosted on Github, anyone fancy a pull request? :)
    https://github.com/ozh/ozh-admin-drop-down-menu

  15. war59312
    Member
    Posted 2 months ago #

    Thanks for the fix guys. Works nearly perfectly now.:)

  16. snih
    Member
    Posted 1 month ago #

    @Muhammad Mahmoud: Thank you for the fix, now it looks good again. :) The only thing is that they're sticking on the bottom:

    http://imgur.com/CdsJK8c

    Have you an idea how to center them vertically, too?

  17. Muhammad Mahmoud
    Member
    Posted 1 month ago #

    @Ozh:
    I will do my best soon, if no one fixed it yet.

    @snih:
    i didn't notice it on the first time, to fix this problem you have to override admin area css, and it can't be set as inline style because "before" is a pseudo-class and it's not possible to create inline styles for it.

    so, a temporary solution is to hook on "admin_head" action , by adding the following in your theme "functions.php" file

    add_action('admin_head', 'custom_css');
    
    function custom_css() {
      echo '<style>
        div.wp-menu-image:before  {
          padding:4px 0 !important;
        }
      </style>';
    }

    you can change 4px to any value between 0-7 that you see it fits well with you :)

    hope this help!

  18. snih
    Member
    Posted 1 month ago #

    @Muhammad Mahmoud:
    Thank you. And 4px is working fine to center the icons vertically. :)

  19. brody182
    Member
    Posted 1 month ago #

    I think there are also some styling issues with the plugin

  20. caseyfern
    Member
    Posted 3 weeks ago #

    Ozh, will this be fixed in the plugin itself soon?

  21. wpprem
    Member
    Posted 6 days ago #

    I think this bug is very much annoying.. server log throws thousands of lines for "File not exists".

    As a quick fix i disabled the icons by removing this
    {$img}
    on line number 99 from "\ozh-admin-drop-down-menu\inc\core.php"

Reply

You must log in to post.

About this Plugin

About this Topic