help.php 770 B

12345678910111213141516171819202122232425262728293031
  1. <?php if ( ! defined( 'ABSPATH' ) ) exit;
  2. /**
  3. * Outputs the HTML of the help icon if it is set to display.
  4. *
  5. **/
  6. function ninja_forms_display_field_help( $field_id, $data ){
  7. $plugin_settings = nf_get_settings();
  8. if( isset( $data['show_help'] ) ){
  9. $show_help = $data['show_help'];
  10. }else{
  11. $show_help = 0;
  12. }
  13. if( isset( $data['help_text'] ) ){
  14. $help_text = $data['help_text'];
  15. }else{
  16. $help_text = '';
  17. }
  18. $help_text = htmlspecialchars( $help_text );
  19. if($show_help){
  20. ?>
  21. <img class='ninja-forms-help-text' src="<?php echo NINJA_FORMS_URL;?>images/question-ico.gif" title="<?php echo $help_text;?>" alt="<?php _e( 'Help Text', 'ninja-forms' ); ?>">
  22. <?php
  23. }
  24. }
  25. add_action( 'ninja_forms_display_field_help', 'ninja_forms_display_field_help', 10, 2 );