wpcf7_tag_generator_infusionsoft

The Contact Form 7 - Infusionsoft Add-on wpcf7 tag generator infusionsoft function.

Description

wpcf7_tag_generator_infusionsoft( $contact_form, (string) $args = '' ); 

Parameters (2)

0. $contact_form
The contact form.
1. $args — Optional. (string) => ''
The args.

Usage

  1. if ( !function_exists( 'wpcf7_tag_generator_infusionsoft' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'contact-form-7-infusionsoft-add-on/cf7-infusionsoft-modules.php'; 
  3.  
  4. // The contact form. 
  5. $contact_form = null; 
  6.  
  7. // The args. 
  8. $args = ''; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = wpcf7_tag_generator_infusionsoft($contact_form, $args); 
  12.  

Defined (1)

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

/cf7-infusionsoft-modules.php  
  1. function wpcf7_tag_generator_infusionsoft( $contact_form, $args = '' ) { 
  2. global $infusionsoft_fields; 
  3. $args = wp_parse_args( $args, array() ); 
  4.  
  5. $description = "Generate a form-tag for various InfusionSoft fields. For more details, see %s."; 
  6. $desc_link = wpcf7_link( 'https://wordpress.org/plugins/contact-form-7-infusionsoft-add-on/faq/', 'the add-on FAQs' ); 
  7.  
  8. ?> 
  9. <div class="control-box"> 
  10. <fieldset> 
  11. <legend><?php echo sprintf( esc_html( $description ), $desc_link ); ?></legend> 
  12.  
  13. <table class="form-table"> 
  14. <tbody> 
  15. <tr> 
  16. <th scope="row"><label for="infusionsoft-field-name">Field Type</label></th> 
  17. <td> 
  18. <select name="infusionsoft-field-name" class="tg-name oneline" id="infusionsoft-field-name"> 
  19. <option value="0">--</option> 
  20. <?php  
  21. foreach ($infusionsoft_fields as $value => $name) { 
  22. echo '<option value="' . $value . '">' . $name . '</option>'; 
  23. ?> 
  24. </select> 
  25. </td> 
  26. </tr> 
  27.  
  28. <tr> 
  29. <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-values' ); ?>"><?php echo esc_html( __( 'Default value', 'contact-form-7' ) ); ?></label></th> 
  30. <td><input type="text" name="values" class="oneline" id="<?php echo esc_attr( $args['content'] . '-values' ); ?>" /><br /> 
  31. <label><input type="checkbox" name="placeholder" class="option" /> <?php echo esc_html( __( 'Use this text as the placeholder of the field', 'contact-form-7' ) ); ?></label></td> 
  32. </tr> 
  33.  
  34. <tr> 
  35. <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-id' ); ?>"><?php echo esc_html( __( 'Id attribute', 'contact-form-7' ) ); ?></label></th> 
  36. <td><input type="text" name="id" class="idvalue oneline option" id="<?php echo esc_attr( $args['content'] . '-id' ); ?>" /></td> 
  37. </tr> 
  38.  
  39. <tr> 
  40. <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-class' ); ?>"><?php echo esc_html( __( 'Class attribute', 'contact-form-7' ) ); ?></label></th> 
  41. <td><input type="text" name="class" class="classvalue oneline option" id="<?php echo esc_attr( $args['content'] . '-class' ); ?>" /></td> 
  42. </tr> 
  43.  
  44. <tr> 
  45. <th scope="row"><?php echo esc_html( __( 'Field type', 'contact-form-7' ) ); ?></th> 
  46. <td> 
  47. <fieldset> 
  48. <legend class="screen-reader-text"><?php echo esc_html( __( 'Field type', 'contact-form-7' ) ); ?></legend> 
  49. <label><input type="checkbox" name="required" /> <?php echo esc_html( __( 'Required field', 'contact-form-7' ) ); ?></label> 
  50. </fieldset> 
  51. </td> 
  52. </tr> 
  53. </tbody> 
  54. </table> 
  55. </fieldset> 
  56. </div> 
  57.  
  58. <div class="insert-box" style="height: 100px; bottom: 50px; overflow-x: hidden;"> 
  59. <input type="text" name="text" class="tag code" readonly="readonly" onfocus="this.select()" /> 
  60.  
  61. <div class="submitbox"> 
  62. <input type="button" class="button button-primary insert-tag" value="<?php echo esc_attr( __( 'Insert Tag', 'contact-form-7' ) ); ?>" /> 
  63. </div> 
  64.  
  65. <br class="clear" /> 
  66.  
  67. <p class="description mail-tag"> 
  68. <label for="<?php echo esc_attr( $args['content'] . '-mailtag' ); ?>"> 
  69. <?php echo sprintf( esc_html( __( "To use the value input through this field in a mail field, you need to insert the corresponding mail-tag (%s) into the field on the Mail tab.", 'contact-form-7' ) ), '<strong><span class="mail-tag"></span></strong>' ); ?> 
  70. <input type="text" class="mail-tag code hidden" readonly="readonly" id="<?php echo esc_attr( $args['content'] . '-mailtag' ); ?>" /> 
  71. </label> 
  72. </p> 
  73. </div> 
  74. <?php