wpcf7_tag_generator_captcha

The Contact Form 7 wpcf7 tag generator captcha function.

Description

wpcf7_tag_generator_captcha( $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_captcha' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'contact-form-7/modules/really-simple-captcha.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_captcha($contact_form, $args); 
  12.  

Defined (1)

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

/modules/really-simple-captcha.php  
  1. function wpcf7_tag_generator_captcha( $contact_form, $args = '' ) { 
  2. $args = wp_parse_args( $args, array() ); 
  3.  
  4. if ( ! class_exists( 'ReallySimpleCaptcha' ) ) { 
  5. ?> 
  6. <div class="control-box"> 
  7. <fieldset> 
  8. <legend><?php echo sprintf( esc_html( __( "To use CAPTCHA, you first need to install and activate %s plugin.", 'contact-form-7' ) ), wpcf7_link( 'http://wordpress.org/extend/plugins/really-simple-captcha/', 'Really Simple CAPTCHA' ) ); ?></legend> 
  9. </fieldset> 
  10. </div> 
  11. <?php 
  12.  
  13. return; 
  14.  
  15. $description = __( "Generate form-tags for a CAPTCHA image and corresponding response input field. For more details, see %s.", 'contact-form-7' ); 
  16.  
  17. $desc_link = wpcf7_link( __( 'https://contactform7.com/captcha/', 'contact-form-7' ), __( 'CAPTCHA', 'contact-form-7' ) ); 
  18.  
  19. ?> 
  20. <div class="control-box"> 
  21. <fieldset> 
  22. <legend><?php echo sprintf( esc_html( $description ), $desc_link ); ?></legend> 
  23.  
  24. <table class="form-table"> 
  25. <tbody> 
  26. <tr> 
  27. <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-name' ); ?>"><?php echo esc_html( __( 'Name', 'contact-form-7' ) ); ?></label></th> 
  28. <td><input type="text" name="name" class="tg-name oneline" id="<?php echo esc_attr( $args['content'] . '-name' ); ?>" /></td> 
  29. </tr> 
  30. </tbody> 
  31. </table> 
  32.  
  33. <table class="form-table scope captchac"> 
  34. <caption><?php echo esc_html( __( "Image settings", 'contact-form-7' ) ); ?></caption> 
  35. <tbody> 
  36. <tr> 
  37. <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-captchac-id' ); ?>"><?php echo esc_html( __( 'Id attribute', 'contact-form-7' ) ); ?></label></th> 
  38. <td><input type="text" name="id" class="idvalue oneline option" id="<?php echo esc_attr( $args['content'] . '-captchac-id' ); ?>" /></td> 
  39. </tr> 
  40.  
  41. <tr> 
  42. <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-captchac-class' ); ?>"><?php echo esc_html( __( 'Class attribute', 'contact-form-7' ) ); ?></label></th> 
  43. <td><input type="text" name="class" class="classvalue oneline option" id="<?php echo esc_attr( $args['content'] . '-captchac-class' ); ?>" /></td> 
  44. </tr> 
  45. </tbody> 
  46. </table> 
  47.  
  48. <table class="form-table scope captchar"> 
  49. <caption><?php echo esc_html( __( "Input field settings", 'contact-form-7' ) ); ?></caption> 
  50. <tbody> 
  51. <tr> 
  52. <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-captchar-id' ); ?>"><?php echo esc_html( __( 'Id attribute', 'contact-form-7' ) ); ?></label></th> 
  53. <td><input type="text" name="id" class="idvalue oneline option" id="<?php echo esc_attr( $args['content'] . '-captchar-id' ); ?>" /></td> 
  54. </tr> 
  55.  
  56. <tr> 
  57. <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-captchar-class' ); ?>"><?php echo esc_html( __( 'Class attribute', 'contact-form-7' ) ); ?></label></th> 
  58. <td><input type="text" name="class" class="classvalue oneline option" id="<?php echo esc_attr( $args['content'] . '-captchar-class' ); ?>" /></td> 
  59. </tr> 
  60. </tbody> 
  61. </table> 
  62. </fieldset> 
  63. </div> 
  64.  
  65. <div class="insert-box"> 
  66. <input type="text" name="captcha" class="tag code" readonly="readonly" onfocus="this.select()" /> 
  67.  
  68. <div class="submitbox"> 
  69. <input type="button" class="button button-primary insert-tag" value="<?php echo esc_attr( __( 'Insert Tag', 'contact-form-7' ) ); ?>" /> 
  70. </div> 
  71. </div> 
  72. <?php