ddw_gftb_admin_style

Add the styles for new WordPress Toolbar / Admin Bar entry.

Description

ddw_gftb_admin_style(); 

Usage

  1. if ( !function_exists( 'ddw_gftb_admin_style' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'gravity-forms-toolbar/gravity-forms-toolbar.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = ddw_gftb_admin_style(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/gravity-forms-toolbar.php  
  1. function ddw_gftb_admin_style() { 
  2.  
  3. /** No styles if admin bar is disabled or user is not logged in or items are disabled via constant */ 
  4. if ( ! is_admin_bar_showing() 
  5. || ! is_user_logged_in() 
  6. || ( defined( 'GFTB_DISPLAY' ) && ! GFTB_DISPLAY
  7. ) { 
  8.  
  9. return; 
  10.  
  11. } // end if 
  12.  
  13. /** Add CSS styles to wp_head/admin_head */ 
  14. $gftb_main_icon = apply_filters( 
  15. 'gftb_filter_main_icon',  
  16. plugins_url( '/gravity-forms-toolbar/images/gravityforms-icon.png', dirname( __FILE__ ) ) 
  17. ); 
  18.  
  19. ?> 
  20. <style type="text/css"> 
  21. #wpadminbar.nojs .ab-top-menu > li.menupop.icon-gravityforms:hover > .ab-item,  
  22. #wpadminbar .ab-top-menu > li.menupop.icon-gravityforms.hover > .ab-item,  
  23. #wpadminbar.nojs .ab-top-menu > li.menupop.icon-gravityforms > .ab-item,  
  24. #wpadminbar .ab-top-menu > li.menupop.icon-gravityforms > .ab-item { 
  25. background-image: url(<?php echo $gftb_main_icon; ?>); 
  26. background-repeat: no-repeat; 
  27. background-position: 0.85em 50%; 
  28. padding-left: 30px; 
  29. #wp-admin-bar-ddw-gravityforms-languages-de > a:before,  
  30. #wp-admin-bar-ddw-gravityforms-languages-nl > a:before,  
  31. #wp-admin-bar-ddw-gravityforms-languages-es > a:before { 
  32. content: '* '; 
  33. /*vertical-align: middle;*/ 
  34. margin-top: -2px; 
  35. #wp-admin-bar-ddw-gravityforms-toolbar-default li:first-child { 
  36. border-top: none !important; 
  37. .ddw_gftb-update-available a { 
  38. font-weight: bold !important; 
  39. </style> 
  40. <?php 
  41.  
  42. } // end of function ddw_gftb_admin_style