Advertisement
demon2cute

Functions

Apr 8th, 2014
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. <?php
  2.  
  3. function appthemes_menu_sprite_css( $icons ) {
  4. $sprite_url = get_template_directory_uri() . '/images/admin-menu.png';
  5.  
  6. echo '<style type="text/css">';
  7.  
  8. foreach ( $icons as $i => $selector ) {
  9. $sprite_x = 30 * $i;
  10.  
  11. echo <<<EOB
  12.  
  13. $selector div.wp-menu-image {
  14. background-image: url('$sprite_url');
  15. background-position: -{$sprite_x}px -33px !important;
  16. }
  17.  
  18. $selector div.wp-menu-image img {
  19. display: none;
  20. }
  21.  
  22. $selector:hover div.wp-menu-image,
  23. $selector.wp-has-current-submenu div.wp-menu-image {
  24. background-position: -{$sprite_x}px -1px !important;
  25. }
  26. EOB;
  27. }
  28.  
  29. echo '</style>';
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement