/gravity-forms-progressbar-zero-percent-plugin.php

  1. <?php 
  2. /** 
  3. Plugin Name: Gravity Forms - Start progress bar at zero percent 
  4. Description: Forces the progress bar on multi-page forms to start at zero percent. 
  5. Version: 1.0 
  6. Author: Adrian Gordon 
  7. Author URI: http://www.itsupportguides.com  
  8. License: GPL2 
  9. */ 
  10.  
  11. /** 
  12. * Set progress bar to start at zero 
  13. */ 
  14.  
  15. add_filter('gform_progressbar_start_at_zero', 'itsp_gf_progressbar_zero_percent'); 
  16.  
  17. function itsp_gf_progressbar_zero_percent() 
  18. return true; 
  19.  
  20. /** 
  21. * Place required scripts in the footer 
  22. */ 
  23.  
  24. add_action('gform_enqueue_scripts', 'itsp_gf_progressbar_zero_percent_queue_scripts', 90, 3); 
  25.  
  26.  
  27. function itsp_gf_progressbar_zero_percent_queue_scripts($form, $is_ajax) { 
  28. add_action('wp_footer', 'itsp_gf_progressbar_zero_percent_css_styles'); 
  29.  
  30. /** 
  31. * CSS styles - force 0% to display 
  32. */ 
  33.  
  34. function itsp_gf_progressbar_zero_percent_css_styles() { 
  35. ?> 
  36. <style type="text/css"> 
  37. .percentbar_0 { 
  38. width: 5% !important; 
  39.  
  40. .percentbar_0 span { 
  41. color: #fff !important; 
  42. </style> <?php 
  43.  
  44. ?> 
.