Contact Form 7 - Version 4.6

Version Description

  • Ajax loader: HTML markup changed to <span> to be easily customizable with CSS.
  • Appends a proper header and footer to HTML mail content automatically.
  • [_serial_number] special mail-tag.
  • New form-tag type for hidden fields.
  • default:shortcode_attr form-tag option.
  • WPCF7_Shortcode, WPCF7_ShortcodeManager, wpcf7_add_shortcode(), wpcf7_scan_shortcode(), and some other classes and functions have become deprecated.
  • Removed all language files from the languages folder. Translations have moved to translate.wordpress.org.
Download this release

Release Info

Developer takayukister
Plugin Icon 128x128 Contact Form 7
Version 4.6
Comparing to
See all releases

Code changes from version 4.5.1 to 4.6

Files changed (85) hide show
  1. admin/css/styles-rtl.css +33 -0
  2. admin/css/styles.css +29 -9
  3. admin/includes/class-contact-forms-list-table.php +2 -1
  4. admin/includes/welcome-panel.php +12 -20
  5. includes/config-validator.php +5 -5
  6. includes/contact-form.php +43 -26
  7. includes/controller.php +1 -3
  8. includes/css/styles-rtl.css +2 -3
  9. includes/css/styles.css +19 -3
  10. includes/form-tag.php +321 -0
  11. includes/form-tags-manager.php +259 -0
  12. includes/formatting.php +21 -13
  13. includes/functions.php +16 -9
  14. includes/js/scripts.js +3 -7
  15. includes/mail.php +68 -47
  16. includes/pipe.php +2 -3
  17. includes/shortcodes.php +55 -468
  18. includes/submission.php +12 -5
  19. includes/upgrade.php +10 -7
  20. includes/validation.php +4 -6
  21. languages/contact-form-7-af.mo +0 -0
  22. languages/contact-form-7-ar.mo +0 -0
  23. languages/contact-form-7-bel.mo +0 -0
  24. languages/contact-form-7-bg_BG.mo +0 -0
  25. languages/contact-form-7-bn_BD.mo +0 -0
  26. languages/contact-form-7-bn_IN.mo +0 -0
  27. languages/contact-form-7-bs_BA.mo +0 -0
  28. languages/contact-form-7-ca.mo +0 -0
  29. languages/contact-form-7-ckb.mo +0 -0
  30. languages/contact-form-7-el.mo +0 -0
  31. languages/contact-form-7-eo.mo +0 -0
  32. languages/contact-form-7-eu.mo +0 -0
  33. languages/contact-form-7-fa_IR.mo +0 -0
  34. languages/contact-form-7-ga.mo +0 -0
  35. languages/contact-form-7-gl_ES.mo +0 -0
  36. languages/contact-form-7-gu.mo +0 -0
  37. languages/contact-form-7-hi_IN.mo +0 -0
  38. languages/contact-form-7-ht.mo +0 -0
  39. languages/contact-form-7-hy.mo +0 -0
  40. languages/contact-form-7-id_ID.mo +0 -0
  41. languages/contact-form-7-ka_GE.mo +0 -0
  42. languages/contact-form-7-ko_KR.mo +0 -0
  43. languages/contact-form-7-lt_LT.mo +0 -0
  44. languages/contact-form-7-lv.mo +0 -0
  45. languages/contact-form-7-mk_MK.mo +0 -0
  46. languages/contact-form-7-ml_IN.mo +0 -0
  47. languages/contact-form-7-ms_MY.mo +0 -0
  48. languages/contact-form-7-mt_MT.mo +0 -0
  49. languages/contact-form-7-nb_NO.mo +0 -0
  50. languages/contact-form-7-pa_IN.mo +0 -0
  51. languages/contact-form-7-si_LK.mo +0 -0
  52. languages/contact-form-7-sl_SI.mo +0 -0
  53. languages/contact-form-7-sq.mo +0 -0
  54. languages/contact-form-7-sr_RS.mo +0 -0
  55. languages/contact-form-7-ta_IN.mo +0 -0
  56. languages/contact-form-7-th.mo +0 -0
  57. languages/contact-form-7-tl.mo +0 -0
  58. languages/contact-form-7-uk.mo +0 -0
  59. languages/contact-form-7-vi.mo +0 -0
  60. languages/contact-form-7-zh_CN.mo +0 -0
  61. languages/contact-form-7-zh_TW.mo +0 -0
  62. languages/contact-form-7.pot +0 -1459
  63. languages/readme.txt +3 -8
  64. modules/acceptance.php +19 -14
  65. modules/akismet.php +2 -4
  66. modules/checkbox.php +23 -18
  67. modules/count.php +8 -8
  68. modules/date.php +16 -12
  69. modules/file.php +10 -10
  70. modules/flamingo.php +30 -2
  71. modules/hidden.php +32 -0
  72. modules/listo.php +0 -2
  73. modules/number.php +16 -12
  74. modules/quiz.php +8 -8
  75. modules/really-simple-captcha.php +10 -10
  76. modules/recaptcha.php +6 -6
  77. modules/response.php +7 -5
  78. modules/select.php +14 -11
  79. modules/submit.php +8 -7
  80. modules/text.php +8 -8
  81. modules/textarea.php +8 -8
  82. readme.txt +13 -3
  83. settings.php +3 -0
  84. uninstall.php +6 -7
  85. wp-contact-form-7.php +3 -3
admin/css/styles-rtl.css CHANGED
@@ -1,3 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  .tag-generator-panel {
2
  text-align: right;
3
  }
@@ -15,6 +30,24 @@
15
  float: left;
16
  }
17
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  .card {
19
  border-left: 1px solid #e5e5e5;
20
  border-right: 4px solid #e5e5e5;
1
+ #misc-publishing-actions .misc-pub-section::before {
2
+ right: -1px;
3
+ padding: 0 0 0 2px;
4
+ }
5
+
6
+ /*
7
+ * Tabs
8
+ */
9
+ #contact-form-editor-tabs {
10
+ padding: 9px 10px 0 15px;
11
+ }
12
+
13
+ /*
14
+ * Form Tab
15
+ */
16
  .tag-generator-panel {
17
  text-align: right;
18
  }
30
  float: left;
31
  }
32
 
33
+ /*
34
+ * Mail Tab
35
+ */
36
+ .contact-form-editor-box-mail span.mailtag {
37
+ margin: 0 4px 0 0;
38
+ }
39
+
40
+ /*
41
+ * Welcome Panel
42
+ */
43
+ .welcome-panel .welcome-panel-column,
44
+ .welcome-panel .welcome-panel-column:first-child {
45
+ padding: 0 0 0 2%;
46
+ }
47
+
48
+ /*
49
+ * Integration
50
+ */
51
  .card {
52
  border-left: 1px solid #e5e5e5;
53
  border-right: 4px solid #e5e5e5;
admin/css/styles.css CHANGED
@@ -177,7 +177,7 @@ ul.config-error li a.external {
177
  }
178
 
179
  /*
180
- * Form Panel
181
  */
182
  #tag-generator-list a.button {
183
  font-size: 12px;
@@ -288,7 +288,7 @@ ul.config-error li a.external {
288
  }
289
 
290
  /*
291
- * Mail Panel
292
  */
293
  .contact-form-editor-box-mail span.mailtag {
294
  display: inline-block;
@@ -303,7 +303,7 @@ ul.config-error li a.external {
303
  }
304
 
305
  /*
306
- * Messages Panel
307
  */
308
  #messages-panel p.description {
309
  margin: 5px 0 10px;
@@ -323,20 +323,40 @@ ul.config-error li a.external {
323
  /*
324
  * Welcome Panel
325
  */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
326
  .welcome-panel h3 {
327
  font-size: 16px;
328
  font-weight: 600;
329
  line-height: 2.1em;
330
- margin: 1.33em 0 0;
331
  }
332
 
333
- .welcome-panel p.message {
334
- line-height: 1.4em;
335
- margin-right: 25px;
 
 
 
 
336
  }
337
 
338
- .welcome-panel li {
339
- margin-bottom: 12px;
340
  }
341
 
342
  .welcome-panel-close {
177
  }
178
 
179
  /*
180
+ * Form Tab
181
  */
182
  #tag-generator-list a.button {
183
  font-size: 12px;
288
  }
289
 
290
  /*
291
+ * Mail Tab
292
  */
293
  .contact-form-editor-box-mail span.mailtag {
294
  display: inline-block;
303
  }
304
 
305
  /*
306
+ * Messages Tab
307
  */
308
  #messages-panel p.description {
309
  margin: 5px 0 10px;
323
  /*
324
  * Welcome Panel
325
  */
326
+ .welcome-panel .welcome-panel-column,
327
+ .welcome-panel .welcome-panel-column:first-child {
328
+ width: 48%;
329
+ padding: 0 2% 0 0;
330
+ margin: 0 0 1em 0;
331
+ }
332
+
333
+ @media screen and (max-width: 870px) {
334
+ .welcome-panel .welcome-panel-column,
335
+ .welcome-panel .welcome-panel-column:first-child {
336
+ display: block;
337
+ float: none;
338
+ width: 100%;
339
+ }
340
+ }
341
+
342
  .welcome-panel h3 {
343
  font-size: 16px;
344
  font-weight: 600;
345
  line-height: 2.1em;
346
+ margin: 1em 0 1.2em;
347
  }
348
 
349
+ .welcome-panel h3 .dashicons {
350
+ position: relative;
351
+ top: -2px;
352
+ display: inline-block;
353
+ width: 60px;
354
+ color: #575757;
355
+ font-size: 40px;
356
  }
357
 
358
+ .welcome-panel p a {
359
+ font-weight: bold;
360
  }
361
 
362
  .welcome-panel-close {
admin/includes/class-contact-forms-list-table.php CHANGED
@@ -1,7 +1,8 @@
1
  <?php
2
 
3
- if ( ! class_exists( 'WP_List_Table' ) )
4
  require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
 
5
 
6
  class WPCF7_Contact_Form_List_Table extends WP_List_Table {
7
 
1
  <?php
2
 
3
+ if ( ! class_exists( 'WP_List_Table' ) ) {
4
  require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
5
+ }
6
 
7
  class WPCF7_Contact_Form_List_Table extends WP_List_Table {
8
 
admin/includes/welcome-panel.php CHANGED
@@ -17,31 +17,23 @@ function wpcf7_welcome_panel() {
17
 
18
  <div class="welcome-panel-content">
19
  <div class="welcome-panel-column-container">
20
- <div class="welcome-panel-column">
21
- <h3><?php echo esc_html( __( 'Contact Form 7 Needs Your Support', 'contact-form-7' ) ); ?></h3>
22
- <p class="message"><?php echo esc_html( __( "It is hard to continue development and support for this plugin without contributions from users like you. If you enjoy using Contact Form 7 and find it useful, please consider making a donation.", 'contact-form-7' ) ); ?></p>
23
- <p><?php echo wpcf7_link( __( 'http://contactform7.com/donate/', 'contact-form-7' ), __( 'Donate', 'contact-form-7' ), array( 'class' => 'button button-primary' ) ); ?></p>
24
- </div>
25
 
26
  <div class="welcome-panel-column">
27
- <h3><?php echo esc_html( __( 'Get Started', 'contact-form-7' ) ); ?></h3>
28
- <ul>
29
- <li><?php echo wpcf7_link( __( 'http://contactform7.com/getting-started-with-contact-form-7/', 'contact-form-7' ), __( 'Getting Started with Contact Form 7', 'contact-form-7' ) ); ?></li>
30
- <li><?php echo wpcf7_link( __( 'http://contactform7.com/admin-screen/', 'contact-form-7' ), __( 'Admin Screen', 'contact-form-7' ) ); ?></li>
31
- <li><?php echo wpcf7_link( __( 'http://contactform7.com/tag-syntax/', 'contact-form-7' ), __( 'How Tags Work', 'contact-form-7' ) ); ?></li>
32
- <li><?php echo wpcf7_link( __( 'http://contactform7.com/setting-up-mail/', 'contact-form-7' ), __( 'Setting Up Mail', 'contact-form-7' ) ); ?></li>
33
- </ul>
34
  </div>
35
 
36
  <div class="welcome-panel-column">
37
- <h3><?php echo esc_html( __( 'Did You Know?', 'contact-form-7' ) ); ?></h3>
38
- <ul>
39
- <li><?php echo wpcf7_link( __( 'http://contactform7.com/spam-filtering-with-akismet/', 'contact-form-7' ), __( 'Spam Filtering with Akismet', 'contact-form-7' ) ); ?></li>
40
- <li><?php echo wpcf7_link( __( 'http://contactform7.com/save-submitted-messages-with-flamingo/', 'contact-form-7' ), __( 'Save Messages with Flamingo', 'contact-form-7' ) ); ?></li>
41
- <li><?php echo wpcf7_link( __( 'http://contactform7.com/selectable-recipient-with-pipes/', 'contact-form-7' ), __( 'Selectable Recipient with Pipes', 'contact-form-7' ) ); ?></li>
42
- <li><?php echo wpcf7_link( __( 'http://contactform7.com/tracking-form-submissions-with-google-analytics/', 'contact-form-7' ), __( 'Tracking with Google Analytics', 'contact-form-7' ) ); ?></li>
43
- </ul>
44
  </div>
 
45
  </div>
46
  </div>
47
  </div>
@@ -61,7 +53,7 @@ function wpcf7_admin_ajax_welcome_panel() {
61
  }
62
 
63
  if ( empty( $_POST['visible'] ) ) {
64
- $vers[] = WPCF7_VERSION;
65
  }
66
 
67
  $vers = array_unique( $vers );
17
 
18
  <div class="welcome-panel-content">
19
  <div class="welcome-panel-column-container">
 
 
 
 
 
20
 
21
  <div class="welcome-panel-column">
22
+ <h3><span class="dashicons dashicons-shield"></span> <?php echo esc_html( __( "Getting spammed? You have protection.", 'contact-form-7' ) ); ?></h3>
23
+
24
+ <p><?php echo esc_html( __( "Spammers target everything; your contact forms aren&#8217;t an exception. Before you get spammed, protect your contact forms with the powerful anti-spam features Contact Form 7 provides.", 'contact-form-7' ) ); ?></p>
25
+
26
+ <p><?php echo sprintf( esc_html( __( 'Contact Form 7 supports spam-filtering with %1$s. Intelligent %2$s blocks annoying spambots. Plus, using %3$s, you can block messages containing specified keywords or those sent from specified IP addresses.', 'contact-form-7' ) ), wpcf7_link( __( 'http://contactform7.com/spam-filtering-with-akismet/', 'contact-form-7' ), __( 'Akismet', 'contact-form-7' ) ), wpcf7_link( __( 'http://contactform7.com/recaptcha/', 'contact-form-7' ), __( 'reCAPTCHA', 'contact-form-7' ) ), wpcf7_link( __( 'http://contactform7.com/comment-blacklist/', 'contact-form-7' ), __( 'comment blacklist', 'contact-form-7' ) ) ); ?></p>
 
 
27
  </div>
28
 
29
  <div class="welcome-panel-column">
30
+ <h3><span class="dashicons dashicons-editor-help"></span> <?php echo esc_html( __( "Before you cry over spilt mail&#8230;", 'contact-form-7' ) ); ?></h3>
31
+
32
+ <p><?php echo esc_html( __( "Contact Form 7 doesn&#8217;t store submitted messages anywhere. Therefore, you may lose important messages forever if your mail server has issues or you make a mistake in mail configuration.", 'contact-form-7' ) ); ?></p>
33
+
34
+ <p><?php echo sprintf( esc_html( __( 'Install a message storage plugin before this happens to you. %s saves all messages through contact forms into the database. Flamingo is a free WordPress plugin created by the same author as Contact Form 7.', 'contact-form-7' ) ), wpcf7_link( __( 'http://contactform7.com/save-submitted-messages-with-flamingo/', 'contact-form-7' ), __( 'Flamingo', 'contact-form-7' ) ) ); ?></p>
 
 
35
  </div>
36
+
37
  </div>
38
  </div>
39
  </div>
53
  }
54
 
55
  if ( empty( $_POST['visible'] ) ) {
56
+ $vers[] = wpcf7_version( 'only_major=1' );
57
  }
58
 
59
  $vers = array_unique( $vers );
includes/config-validator.php CHANGED
@@ -175,14 +175,14 @@ class WPCF7_ConfigValidator {
175
  $pattern = '%<label(?:[ \t\n]+.*?)?>(.+?)</label>%s';
176
 
177
  if ( preg_match_all( $pattern, $body, $matches ) ) {
178
- $manager = WPCF7_ShortcodeManager::get_instance();
179
 
180
  foreach ( $matches[1] as $insidelabel ) {
181
- $tags = $manager->scan_shortcode( $insidelabel );
182
  $fields_count = 0;
183
 
184
  foreach ( $tags as $tag ) {
185
- $tag = new WPCF7_Shortcode( $tag );
186
 
187
  if ( in_array( $tag->basetype, array( 'checkbox', 'radio' ) ) ) {
188
  $fields_count += count( $tag->values );
@@ -362,11 +362,11 @@ class WPCF7_ConfigValidator {
362
  $example_text = 'example';
363
  $example_blank = '';
364
 
365
- $form_tags = $this->contact_form->form_scan_shortcode(
366
  array( 'name' => $tagname ) );
367
 
368
  if ( $form_tags ) {
369
- $form_tag = new WPCF7_Shortcode( $form_tags[0] );
370
 
371
  $is_required = ( $form_tag->is_required() || 'radio' == $form_tag->type );
372
 
175
  $pattern = '%<label(?:[ \t\n]+.*?)?>(.+?)</label>%s';
176
 
177
  if ( preg_match_all( $pattern, $body, $matches ) ) {
178
+ $manager = WPCF7_FormTagsManager::get_instance();
179
 
180
  foreach ( $matches[1] as $insidelabel ) {
181
+ $tags = $manager->scan( $insidelabel );
182
  $fields_count = 0;
183
 
184
  foreach ( $tags as $tag ) {
185
+ $tag = new WPCF7_FormTag( $tag );
186
 
187
  if ( in_array( $tag->basetype, array( 'checkbox', 'radio' ) ) ) {
188
  $fields_count += count( $tag->values );
362
  $example_text = 'example';
363
  $example_blank = '';
364
 
365
+ $form_tags = $this->contact_form->scan_form_tags(
366
  array( 'name' => $tagname ) );
367
 
368
  if ( $form_tags ) {
369
+ $form_tag = new WPCF7_FormTag( $form_tags[0] );
370
 
371
  $is_required = ( $form_tag->is_required() || 'radio' == $form_tag->type );
372
 
includes/contact-form.php CHANGED
@@ -14,6 +14,7 @@ class WPCF7_ContactForm {
14
  private $unit_tag;
15
  private $responses_count = 0;
16
  private $scanned_form_tags;
 
17
 
18
  public static function count() {
19
  return self::$found_items;
@@ -101,9 +102,7 @@ class WPCF7_ContactForm {
101
  return false;
102
  }
103
 
104
- self::$current = $contact_form = new self( $post );
105
-
106
- return $contact_form;
107
  }
108
 
109
  private static function get_unit_tag( $id = 0 ) {
@@ -229,6 +228,12 @@ class WPCF7_ContactForm {
229
  $this->title = $title;
230
  }
231
 
 
 
 
 
 
 
232
  // Return true if this form is the same one as currently POSTed.
233
  public function is_posted() {
234
  if ( ! WPCF7_Submission::get_instance() ) {
@@ -251,6 +256,8 @@ class WPCF7_ContactForm {
251
  'html_class' => '',
252
  'output' => 'form' ) );
253
 
 
 
254
  if ( 'raw_form' == $args['output'] ) {
255
  return '<pre class="wpcf7-raw-form"><code>'
256
  . esc_html( $this->prop( 'form' ) ) . '</code></pre>';
@@ -496,28 +503,35 @@ class WPCF7_ContactForm {
496
 
497
  /* Form Elements */
498
 
499
- public function form_do_shortcode() {
500
- $manager = WPCF7_ShortcodeManager::get_instance();
501
  $form = $this->prop( 'form' );
502
 
503
  if ( WPCF7_AUTOP ) {
504
- $form = $manager->normalize_shortcode( $form );
505
  $form = wpcf7_autop( $form );
506
  }
507
 
508
- $form = $manager->do_shortcode( $form );
509
  $this->scanned_form_tags = $manager->get_scanned_tags();
510
 
511
  return $form;
512
  }
513
 
514
- public function form_scan_shortcode( $cond = null ) {
515
- $manager = WPCF7_ShortcodeManager::get_instance();
 
 
 
 
 
 
 
516
 
517
  if ( ! empty( $this->scanned_form_tags ) ) {
518
  $scanned = $this->scanned_form_tags;
519
  } else {
520
- $scanned = $manager->scan_shortcode( $this->prop( 'form' ) );
521
  $this->scanned_form_tags = $scanned;
522
  }
523
 
@@ -563,8 +577,16 @@ class WPCF7_ContactForm {
563
  return array_values( $scanned );
564
  }
565
 
 
 
 
 
 
 
 
566
  public function form_elements() {
567
- return apply_filters( 'wpcf7_form_elements', $this->form_do_shortcode() );
 
568
  }
569
 
570
  public function collect_mail_tags( $args = '' ) {
@@ -573,7 +595,7 @@ class WPCF7_ContactForm {
573
  'exclude' => array(
574
  'acceptance', 'captchac', 'captchar', 'quiz', 'count' ) ) );
575
 
576
- $tags = $this->form_scan_shortcode();
577
  $mailtags = array();
578
 
579
  foreach ( (array) $tags as $tag ) {
@@ -674,15 +696,17 @@ class WPCF7_ContactForm {
674
  /* Additional settings */
675
 
676
  public function additional_setting( $name, $max = 1 ) {
677
- $tmp_settings = (array) explode( "\n", $this->prop( 'additional_settings' ) );
678
 
 
679
  $count = 0;
680
  $values = array();
681
 
682
- foreach ( $tmp_settings as $setting ) {
683
- if ( preg_match('/^([a-zA-Z0-9_]+)[\t ]*:(.*)$/', $setting, $matches ) ) {
684
- if ( $matches[1] != $name )
685
  continue;
 
686
 
687
  if ( ! $max || $count < (int) $max ) {
688
  $values[] = trim( $matches[2] );
@@ -698,8 +722,9 @@ class WPCF7_ContactForm {
698
  $settings = $this->additional_setting( $name, false );
699
 
700
  foreach ( $settings as $setting ) {
701
- if ( in_array( $setting, array( 'on', 'true', '1' ) ) )
702
  return true;
 
703
  }
704
 
705
  return false;
@@ -890,14 +915,6 @@ function wpcf7_get_message( $status ) {
890
  return $contact_form->message( $status );
891
  }
892
 
893
- function wpcf7_scan_shortcode( $cond = null ) {
894
- if ( ! $contact_form = wpcf7_get_current_contact_form() ) {
895
- return array();
896
- }
897
-
898
- return $contact_form->form_scan_shortcode( $cond );
899
- }
900
-
901
  function wpcf7_form_controls_class( $type, $default = '' ) {
902
  $type = trim( $type );
903
  $default = array_filter( explode( ' ', $default ) );
@@ -930,7 +947,7 @@ function wpcf7_contact_form_tag_func( $atts, $content = null, $code = '' ) {
930
  'html_id' => '',
931
  'html_name' => '',
932
  'html_class' => '',
933
- 'output' => 'form' ), $atts );
934
 
935
  $id = (int) $atts['id'];
936
  $title = trim( $atts['title'] );
14
  private $unit_tag;
15
  private $responses_count = 0;
16
  private $scanned_form_tags;
17
+ private $shortcode_atts = array();
18
 
19
  public static function count() {
20
  return self::$found_items;
102
  return false;
103
  }
104
 
105
+ return self::$current = new self( $post );
 
 
106
  }
107
 
108
  private static function get_unit_tag( $id = 0 ) {
228
  $this->title = $title;
229
  }
230
 
231
+ public function shortcode_attr( $name ) {
232
+ if ( isset( $this->shortcode_atts[$name] ) ) {
233
+ return (string) $this->shortcode_atts[$name];
234
+ }
235
+ }
236
+
237
  // Return true if this form is the same one as currently POSTed.
238
  public function is_posted() {
239
  if ( ! WPCF7_Submission::get_instance() ) {
256
  'html_class' => '',
257
  'output' => 'form' ) );
258
 
259
+ $this->shortcode_atts = $args;
260
+
261
  if ( 'raw_form' == $args['output'] ) {
262
  return '<pre class="wpcf7-raw-form"><code>'
263
  . esc_html( $this->prop( 'form' ) ) . '</code></pre>';
503
 
504
  /* Form Elements */
505
 
506
+ public function replace_all_form_tags() {
507
+ $manager = WPCF7_FormTagsManager::get_instance();
508
  $form = $this->prop( 'form' );
509
 
510
  if ( WPCF7_AUTOP ) {
511
+ $form = $manager->normalize( $form );
512
  $form = wpcf7_autop( $form );
513
  }
514
 
515
+ $form = $manager->replace_all( $form );
516
  $this->scanned_form_tags = $manager->get_scanned_tags();
517
 
518
  return $form;
519
  }
520
 
521
+ public function form_do_shortcode() {
522
+ wpcf7_deprecated_function( __METHOD__, '4.6',
523
+ 'WPCF7_ContactForm::replace_all_form_tags' );
524
+
525
+ return $this->replace_all_form_tags();
526
+ }
527
+
528
+ public function scan_form_tags( $cond = null ) {
529
+ $manager = WPCF7_FormTagsManager::get_instance();
530
 
531
  if ( ! empty( $this->scanned_form_tags ) ) {
532
  $scanned = $this->scanned_form_tags;
533
  } else {
534
+ $scanned = $manager->scan( $this->prop( 'form' ) );
535
  $this->scanned_form_tags = $scanned;
536
  }
537
 
577
  return array_values( $scanned );
578
  }
579
 
580
+ public function form_scan_shortcode( $cond = null ) {
581
+ wpcf7_deprecated_function( __METHOD__, '4.6',
582
+ 'WPCF7_ContactForm::scan_form_tags' );
583
+
584
+ return $this->scan_form_tags( $cond );
585
+ }
586
+
587
  public function form_elements() {
588
+ return apply_filters( 'wpcf7_form_elements',
589
+ $this->replace_all_form_tags() );
590
  }
591
 
592
  public function collect_mail_tags( $args = '' ) {
595
  'exclude' => array(
596
  'acceptance', 'captchac', 'captchar', 'quiz', 'count' ) ) );
597
 
598
+ $tags = $this->scan_form_tags();
599
  $mailtags = array();
600
 
601
  foreach ( (array) $tags as $tag ) {
696
  /* Additional settings */
697
 
698
  public function additional_setting( $name, $max = 1 ) {
699
+ $settings = (array) explode( "\n", $this->prop( 'additional_settings' ) );
700
 
701
+ $pattern = '/^([a-zA-Z0-9_]+)[\t ]*:(.*)$/';
702
  $count = 0;
703
  $values = array();
704
 
705
+ foreach ( $settings as $setting ) {
706
+ if ( preg_match( $pattern, $setting, $matches ) ) {
707
+ if ( $matches[1] != $name ) {
708
  continue;
709
+ }
710
 
711
  if ( ! $max || $count < (int) $max ) {
712
  $values[] = trim( $matches[2] );
722
  $settings = $this->additional_setting( $name, false );
723
 
724
  foreach ( $settings as $setting ) {
725
+ if ( in_array( $setting, array( 'on', 'true', '1' ) ) ) {
726
  return true;
727
+ }
728
  }
729
 
730
  return false;
915
  return $contact_form->message( $status );
916
  }
917
 
 
 
 
 
 
 
 
 
918
  function wpcf7_form_controls_class( $type, $default = '' ) {
919
  $type = trim( $type );
920
  $default = array_filter( explode( ' ', $default ) );
947
  'html_id' => '',
948
  'html_name' => '',
949
  'html_class' => '',
950
+ 'output' => 'form' ), $atts, 'wpcf7' );
951
 
952
  $id = (int) $atts['id'];
953
  $title = trim( $atts['title'] );
includes/controller.php CHANGED
@@ -165,12 +165,10 @@ function wpcf7_enqueue_scripts() {
165
  array( 'jquery', 'jquery-form' ), WPCF7_VERSION, $in_footer );
166
 
167
  $_wpcf7 = array(
168
- 'loaderUrl' => wpcf7_ajax_loader(),
169
  'recaptcha' => array(
170
  'messages' => array(
171
  'empty' => __( 'Please verify that you are not a robot.',
172
- 'contact-form-7' ) ) ),
173
- 'sending' => __( 'Sending ...', 'contact-form-7' ) );
174
 
175
  if ( defined( 'WP_CACHE' ) && WP_CACHE ) {
176
  $_wpcf7['cached'] = 1;
165
  array( 'jquery', 'jquery-form' ), WPCF7_VERSION, $in_footer );
166
 
167
  $_wpcf7 = array(
 
168
  'recaptcha' => array(
169
  'messages' => array(
170
  'empty' => __( 'Please verify that you are not a robot.',
171
+ 'contact-form-7' ) ) ) );
 
172
 
173
  if ( defined( 'WP_CACHE' ) && WP_CACHE ) {
174
  $_wpcf7['cached'] = 1;
includes/css/styles-rtl.css CHANGED
@@ -2,12 +2,11 @@ span.wpcf7-not-valid-tip {
2
  direction: rtl;
3
  }
4
 
5
- .use-floating-validation-tip span.wpcf7-not-valid-tip {
6
  left: auto;
7
  right: 20%;
8
  }
9
 
10
  span.wpcf7-list-item {
11
- margin-left: 0;
12
- margin-right: 0.5em;
13
  }
2
  direction: rtl;
3
  }
4
 
5
+ .use-floating-validation-tip span.wpcf7-not-valid-tip {
6
  left: auto;
7
  right: 20%;
8
  }
9
 
10
  span.wpcf7-list-item {
11
+ margin: 0 1em 0 0;
 
12
  }
includes/css/styles.css CHANGED
@@ -56,17 +56,33 @@ span.wpcf7-not-valid-tip {
56
  }
57
 
58
  span.wpcf7-list-item {
59
- margin-left: 0.5em;
 
 
 
 
 
 
60
  }
61
 
62
  .wpcf7-display-none {
63
  display: none;
64
  }
65
 
66
- div.wpcf7 img.ajax-loader {
 
 
 
 
 
67
  border: none;
 
 
68
  vertical-align: middle;
69
- margin-left: 4px;
 
 
 
70
  }
71
 
72
  div.wpcf7 div.ajax-error {
56
  }
57
 
58
  span.wpcf7-list-item {
59
+ display: inline-block;
60
+ margin: 0 0 0 1em;
61
+ }
62
+
63
+ span.wpcf7-list-item-label::before,
64
+ span.wpcf7-list-item-label::after {
65
+ content: " ";
66
  }
67
 
68
  .wpcf7-display-none {
69
  display: none;
70
  }
71
 
72
+ div.wpcf7 .ajax-loader {
73
+ visibility: hidden;
74
+ display: inline-block;
75
+ background-image: url('../../images/ajax-loader.gif');
76
+ width: 16px;
77
+ height: 16px;
78
  border: none;
79
+ padding: 0;
80
+ margin: 0 0 0 4px;
81
  vertical-align: middle;
82
+ }
83
+
84
+ div.wpcf7 .ajax-loader.is-active {
85
+ visibility: visible;
86
  }
87
 
88
  div.wpcf7 div.ajax-error {
includes/form-tag.php ADDED
@@ -0,0 +1,321 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WPCF7_FormTag {
4
+
5
+ public $type;
6
+ public $basetype;
7
+ public $name = '';
8
+ public $options = array();
9
+ public $raw_values = array();
10
+ public $values = array();
11
+ public $pipes;
12
+ public $labels = array();
13
+ public $attr = '';
14
+ public $content = '';
15
+
16
+ public function __construct( $tag ) {
17
+ foreach ( $tag as $key => $value ) {
18
+ if ( property_exists( __CLASS__, $key ) ) {
19
+ $this->{$key} = $value;
20
+ }
21
+ }
22
+ }
23
+
24
+ public function is_required() {
25
+ return ( '*' == substr( $this->type, -1 ) );
26
+ }
27
+
28
+ public function has_option( $opt ) {
29
+ $pattern = sprintf( '/^%s(:.+)?$/i', preg_quote( $opt, '/' ) );
30
+ return (bool) preg_grep( $pattern, $this->options );
31
+ }
32
+
33
+ public function get_option( $opt, $pattern = '', $single = false ) {
34
+ $preset_patterns = array(
35
+ 'date' => '([0-9]{4}-[0-9]{2}-[0-9]{2}|today(.*))',
36
+ 'int' => '[0-9]+',
37
+ 'signed_int' => '-?[0-9]+',
38
+ 'class' => '[-0-9a-zA-Z_]+',
39
+ 'id' => '[-0-9a-zA-Z_]+' );
40
+
41
+ if ( isset( $preset_patterns[$pattern] ) ) {
42
+ $pattern = $preset_patterns[$pattern];
43
+ }
44
+
45
+ if ( '' == $pattern ) {
46
+ $pattern = '.+';
47
+ }
48
+
49
+ $pattern = sprintf( '/^%s:%s$/i', preg_quote( $opt, '/' ), $pattern );
50
+
51
+ if ( $single ) {
52
+ $matches = $this->get_first_match_option( $pattern );
53
+
54
+ if ( ! $matches ) {
55
+ return false;
56
+ }
57
+
58
+ return substr( $matches[0], strlen( $opt ) + 1 );
59
+ } else {
60
+ $matches_a = $this->get_all_match_options( $pattern );
61
+
62
+ if ( ! $matches_a ) {
63
+ return false;
64
+ }
65
+
66
+ $results = array();
67
+
68
+ foreach ( $matches_a as $matches ) {
69
+ $results[] = substr( $matches[0], strlen( $opt ) + 1 );
70
+ }
71
+
72
+ return $results;
73
+ }
74
+ }
75
+
76
+ public function get_id_option() {
77
+ return $this->get_option( 'id', 'id', true );
78
+ }
79
+
80
+ public function get_class_option( $default = '' ) {
81
+ if ( is_string( $default ) ) {
82
+ $default = explode( ' ', $default );
83
+ }
84
+
85
+ $options = array_merge(
86
+ (array) $default,
87
+ (array) $this->get_option( 'class', 'class' ) );
88
+
89
+ $options = array_filter( array_unique( $options ) );
90
+
91
+ return implode( ' ', $options );
92
+ }
93
+
94
+ public function get_size_option( $default = '' ) {
95
+ $option = $this->get_option( 'size', 'int', true );
96
+
97
+ if ( $option ) {
98
+ return $option;
99
+ }
100
+
101
+ $matches_a = $this->get_all_match_options( '%^([0-9]*)/[0-9]*$%' );
102
+
103
+ foreach ( (array) $matches_a as $matches ) {
104
+ if ( isset( $matches[1] ) && '' !== $matches[1] ) {
105
+ return $matches[1];
106
+ }
107
+ }
108
+
109
+ return $default;
110
+ }
111
+
112
+ public function get_maxlength_option( $default = '' ) {
113
+ $option = $this->get_option( 'maxlength', 'int', true );
114
+
115
+ if ( $option ) {
116
+ return $option;
117
+ }
118
+
119
+ $matches_a = $this->get_all_match_options(
120
+ '%^(?:[0-9]*x?[0-9]*)?/([0-9]+)$%' );
121
+
122
+ foreach ( (array) $matches_a as $matches ) {
123
+ if ( isset( $matches[1] ) && '' !== $matches[1] ) {
124
+ return $matches[1];
125
+ }
126
+ }
127
+
128
+ return $default;
129
+ }
130
+
131
+ public function get_minlength_option( $default = '' ) {
132
+ $option = $this->get_option( 'minlength', 'int', true );
133
+
134
+ if ( $option ) {
135
+ return $option;
136
+ } else {
137
+ return $default;
138
+ }
139
+ }
140
+
141
+ public function get_cols_option( $default = '' ) {
142
+ $option = $this->get_option( 'cols', 'int', true );
143
+
144
+ if ( $option ) {
145
+ return $option;
146
+ }
147
+
148
+ $matches_a = $this->get_all_match_options(
149
+ '%^([0-9]*)x([0-9]*)(?:/[0-9]+)?$%' );
150
+
151
+ foreach ( (array) $matches_a as $matches ) {
152
+ if ( isset( $matches[1] ) && '' !== $matches[1] ) {
153
+ return $matches[1];
154
+ }
155
+ }
156
+
157
+ return $default;
158
+ }
159
+
160
+ public function get_rows_option( $default = '' ) {
161
+ $option = $this->get_option( 'rows', 'int', true );
162
+
163
+ if ( $option ) {
164
+ return $option;
165
+ }
166
+
167
+ $matches_a = $this->get_all_match_options(
168
+ '%^([0-9]*)x([0-9]*)(?:/[0-9]+)?$%' );
169
+
170
+ foreach ( (array) $matches_a as $matches ) {
171
+ if ( isset( $matches[2] ) && '' !== $matches[2] ) {
172
+ return $matches[2];
173
+ }
174
+ }
175
+
176
+ return $default;
177
+ }
178
+
179
+ public function get_date_option( $opt ) {
180
+ $option = $this->get_option( $opt, 'date', true );
181
+
182
+ if ( preg_match( '/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/', $option ) ) {
183
+ return $option;
184
+ }
185
+
186
+ if ( preg_match( '/^today(?:([+-][0-9]+)([a-z]*))?/', $option, $matches ) ) {
187
+ $number = isset( $matches[1] ) ? (int) $matches[1] : 0;
188
+ $unit = isset( $matches[2] ) ? $matches[2] : '';
189
+
190
+ if ( ! preg_match( '/^(day|month|year|week)s?$/', $unit ) ) {
191
+ $unit = 'days';
192
+ }
193
+
194
+ $date = gmdate( 'Y-m-d',
195
+ strtotime( sprintf( 'today %1$s %2$s', $number, $unit ) ) );
196
+ return $date;
197
+ }
198
+
199
+ return false;
200
+ }
201
+
202
+ public function get_default_option( $default = '', $args = '' ) {
203
+ $args = wp_parse_args( $args, array(
204
+ 'multiple' => false ) );
205
+
206
+ $options = (array) $this->get_option( 'default' );
207
+ $values = array();
208
+
209
+ if ( empty( $options ) ) {
210
+ return $args['multiple'] ? $values : $default;
211
+ }
212
+
213
+ foreach ( $options as $opt ) {
214
+ $opt = sanitize_key( $opt );
215
+
216
+ if ( 'user_' == substr( $opt, 0, 5 ) && is_user_logged_in() ) {
217
+ $primary_props = array( 'user_login', 'user_email', 'user_url' );
218
+ $opt = in_array( $opt, $primary_props ) ? $opt : substr( $opt, 5 );
219
+
220
+ $user = wp_get_current_user();
221
+ $user_prop = $user->get( $opt );
222
+
223
+ if ( ! empty( $user_prop ) ) {
224
+ if ( $args['multiple'] ) {
225
+ $values[] = $user_prop;
226
+ } else {
227
+ return $user_prop;
228
+ }
229
+ }
230
+
231
+ } elseif ( 'post_meta' == $opt && in_the_loop() ) {
232
+ if ( $args['multiple'] ) {
233
+ $values = array_merge( $values,
234
+ get_post_meta( get_the_ID(), $this->name ) );
235
+ } else {
236
+ $val = (string) get_post_meta( get_the_ID(), $this->name, true );
237
+
238
+ if ( strlen( $val ) ) {
239
+ return $val;
240
+ }
241
+ }
242
+
243
+ } elseif ( 'get' == $opt && isset( $_GET[$this->name] ) ) {
244
+ $vals = (array) $_GET[$this->name];
245
+ $vals = array_map( 'wpcf7_sanitize_query_var', $vals );
246
+
247
+ if ( $args['multiple'] ) {
248
+ $values = array_merge( $values, $vals );
249
+ } else {
250
+ $val = isset( $vals[0] ) ? (string) $vals[0] : '';
251
+
252
+ if ( strlen( $val ) ) {
253
+ return $val;
254
+ }
255
+ }
256
+
257
+ } elseif ( 'post' == $opt && isset( $_POST[$this->name] ) ) {
258
+ $vals = (array) $_POST[$this->name];
259
+ $vals = array_map( 'wpcf7_sanitize_query_var', $vals );
260
+
261
+ if ( $args['multiple'] ) {
262
+ $values = array_merge( $values, $vals );
263
+ } else {
264
+ $val = isset( $vals[0] ) ? (string) $vals[0] : '';
265
+
266
+ if ( strlen( $val ) ) {
267
+ return $val;
268
+ }
269
+ }
270
+
271
+ } elseif ( 'shortcode_attr' == $opt ) {
272
+ if ( $contact_form = WPCF7_ContactForm::get_current() ) {
273
+ $val = $contact_form->shortcode_attr( $this->name );
274
+
275
+ if ( strlen( $val ) ) {
276
+ if ( $args['multiple'] ) {
277
+ $values[] = $val;
278
+ } else {
279
+ return $val;
280
+ }
281
+ }
282
+ }
283
+ }
284
+ }
285
+
286
+ if ( $args['multiple'] ) {
287
+ $values = array_unique( $values );
288
+ return $values;
289
+ } else {
290
+ return $default;
291
+ }
292
+ }
293
+
294
+ public function get_data_option( $args = '' ) {
295
+ $options = (array) $this->get_option( 'data' );
296
+
297
+ return apply_filters( 'wpcf7_form_tag_data_option', null, $options, $args );
298
+ }
299
+
300
+ public function get_first_match_option( $pattern ) {
301
+ foreach( (array) $this->options as $option ) {
302
+ if ( preg_match( $pattern, $option, $matches ) ) {
303
+ return $matches;
304
+ }
305
+ }
306
+
307
+ return false;
308
+ }
309
+
310
+ public function get_all_match_options( $pattern ) {
311
+ $result = array();
312
+
313
+ foreach( (array) $this->options as $option ) {
314
+ if ( preg_match( $pattern, $option, $matches ) ) {
315
+ $result[] = $matches;
316
+ }
317
+ }
318
+
319
+ return $result;
320
+ }
321
+ }
includes/form-tags-manager.php ADDED
@@ -0,0 +1,259 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function wpcf7_add_form_tag( $tag, $func, $has_name = false ) {
4
+ $manager = WPCF7_FormTagsManager::get_instance();
5
+
6
+ return $manager->add( $tag, $func, $has_name );
7
+ }
8
+
9
+ function wpcf7_remove_form_tag( $tag ) {
10
+ $manager = WPCF7_FormTagsManager::get_instance();
11
+
12
+ return $manager->remove( $tag );
13
+ }
14
+
15
+ function wpcf7_replace_all_form_tags( $content ) {
16
+ $manager = WPCF7_FormTagsManager::get_instance();
17
+
18
+ return $manager->replace_all( $content );
19
+ }
20
+
21
+ function wpcf7_scan_form_tags( $cond = null ) {
22
+ $contact_form = WPCF7_ContactForm::get_current();
23
+
24
+ if ( $contact_form ) {
25
+ return $contact_form->scan_form_tags( $cond );
26
+ }
27
+
28
+ return array();
29
+ }
30
+
31
+ class WPCF7_FormTagsManager {
32
+
33
+ private static $instance;
34
+
35
+ private $tags = array();
36
+ private $scanned_tags = null; // Tags scanned at the last time of scan()
37
+
38
+ private function __construct() {}
39
+
40
+ public static function get_instance() {
41
+ if ( empty( self::$instance ) ) {
42
+ self::$instance = new self;
43
+ }
44
+
45
+ return self::$instance;
46
+ }
47
+
48
+ public function get_scanned_tags() {
49
+ return $this->scanned_tags;
50
+ }
51
+
52
+ public function add( $tag, $func, $has_name = false ) {
53
+ if ( ! is_callable( $func ) ) {
54
+ return;
55
+ }
56
+
57
+ $tags = array_filter( array_unique( (array) $tag ) );
58
+
59
+ foreach ( $tags as $tag ) {
60
+ $tag = $this->sanitize_tag_type( $tag );
61
+
62
+ if ( ! $this->tag_type_exists( $tag ) ) {
63
+ $this->tags[$tag] = array(
64
+ 'function' => $func,
65
+ 'has_name' => (boolean) $has_name );
66
+ }
67
+ }
68
+ }
69
+
70
+ public function tag_type_exists( $tag ) {
71
+ return isset( $this->tags[$tag] );
72
+ }
73
+
74
+ private function sanitize_tag_type( $tag ) {
75
+ $tag = preg_replace( '/[^a-zA-Z0-9_*]+/', '_', $tag );
76
+ $tag = rtrim( $tag, '_' );
77
+ $tag = strtolower( $tag );
78
+ return $tag;
79
+ }
80
+
81
+ public function remove( $tag ) {
82
+ unset( $this->tags[$tag] );
83
+ }
84
+
85
+ public function normalize( $content ) {
86
+ if ( empty( $this->tags ) ) {
87
+ return $content;
88
+ }
89
+
90
+ $content = preg_replace_callback(
91
+ '/' . $this->tag_regex() . '/s',
92
+ array( $this, 'normalize_callback' ),
93
+ $content );
94
+
95
+ return $content;
96
+ }
97
+
98
+ private function normalize_callback( $m ) {
99
+ // allow [[foo]] syntax for escaping a tag
100
+ if ( $m[1] == '[' && $m[6] == ']' ) {
101
+ return $m[0];
102
+ }
103
+
104
+ $tag = $m[2];
105
+
106
+ $attr = trim( preg_replace( '/[\r\n\t ]+/', ' ', $m[3] ) );
107
+ $attr = strtr( $attr, array( '<' => '&lt;', '>' => '&gt;' ) );
108
+
109
+ $content = trim( $m[5] );
110
+ $content = str_replace( "\n", '<WPPreserveNewline />', $content );
111
+
112
+ $result = $m[1] . '[' . $tag
113
+ . ( $attr ? ' ' . $attr : '' )
114
+ . ( $m[4] ? ' ' . $m[4] : '' )
115
+ . ']'
116
+ . ( $content ? $content . '[/' . $tag . ']' : '' )
117
+ . $m[6];
118
+
119
+ return $result;
120
+ }
121
+
122
+ public function replace_all( $content ) {
123
+ return $this->scan( $content, true );
124
+ }
125
+
126
+ public function scan( $content, $replace = false ) {
127
+ $this->scanned_tags = array();
128
+
129
+ if ( empty( $this->tags ) ) {
130
+ if ( $replace ) {
131
+ return $content;
132
+ } else {
133
+ return $this->scanned_tags;
134
+ }
135
+ }
136
+
137
+ if ( $replace ) {
138
+ $content = preg_replace_callback(
139
+ '/' . $this->tag_regex() . '/s',
140
+ array( $this, 'replace_callback' ),
141
+ $content );
142
+
143
+ return $content;
144
+ } else {
145
+ preg_replace_callback(
146
+ '/' . $this->tag_regex() . '/s',
147
+ array( $this, 'scan_callback' ),
148
+ $content );
149
+
150
+ return $this->scanned_tags;
151
+ }
152
+ }
153
+
154
+ private function tag_regex() {
155
+ $tagnames = array_keys( $this->tags );
156
+ $tagregexp = join( '|', array_map( 'preg_quote', $tagnames ) );
157
+
158
+ return '(\[?)'
159
+ . '\[(' . $tagregexp . ')(?:[\r\n\t ](.*?))?(?:[\r\n\t ](\/))?\]'
160
+ . '(?:([^[]*?)\[\/\2\])?'
161
+ . '(\]?)';
162
+ }
163
+
164
+ private function replace_callback( $m ) {
165
+ return $this->scan_callback( $m, true );
166
+ }
167
+
168
+ private function scan_callback( $m, $replace = false ) {
169
+ // allow [[foo]] syntax for escaping a tag
170
+ if ( $m[1] == '[' && $m[6] == ']' ) {
171
+ return substr( $m[0], 1, -1 );
172
+ }
173
+
174
+ $tag = $m[2];
175
+ $attr = $this->parse_atts( $m[3] );
176
+
177
+ $scanned_tag = array(
178
+ 'type' => $tag,
179
+ 'basetype' => trim( $tag, '*' ),
180
+ 'name' => '',
181
+ 'options' => array(),
182
+ 'raw_values' => array(),
183
+ 'values' => array(),
184
+ 'pipes' => null,
185
+ 'labels' => array(),
186
+ 'attr' => '',
187
+ 'content' => '' );
188
+
189
+ if ( is_array( $attr ) ) {
190
+ if ( is_array( $attr['options'] ) ) {
191
+ if ( $this->tags[$tag]['has_name'] && ! empty( $attr['options'] ) ) {
192
+ $scanned_tag['name'] = array_shift( $attr['options'] );
193
+
194
+ if ( ! wpcf7_is_name( $scanned_tag['name'] ) ) {
195
+ return $m[0]; // Invalid name is used. Ignore this tag.
196
+ }
197
+ }
198
+
199
+ $scanned_tag['options'] = (array) $attr['options'];
200
+ }
201
+
202
+ $scanned_tag['raw_values'] = (array) $attr['values'];
203
+
204
+ if ( WPCF7_USE_PIPE ) {
205
+ $pipes = new WPCF7_Pipes( $scanned_tag['raw_values'] );
206
+ $scanned_tag['values'] = $pipes->collect_befores();
207
+ $scanned_tag['pipes'] = $pipes;
208
+ } else {
209
+ $scanned_tag['values'] = $scanned_tag['raw_values'];
210
+ }
211
+
212
+ $scanned_tag['labels'] = $scanned_tag['values'];
213
+
214
+ } else {
215
+ $scanned_tag['attr'] = $attr;
216
+ }
217
+
218
+ $scanned_tag['values'] = array_map( 'trim', $scanned_tag['values'] );
219
+ $scanned_tag['labels'] = array_map( 'trim', $scanned_tag['labels'] );
220
+
221
+ $content = trim( $m[5] );
222
+ $content = preg_replace( "/<br[\r\n\t ]*\/?>$/m", '', $content );
223
+ $scanned_tag['content'] = $content;
224
+
225
+ $scanned_tag = apply_filters( 'wpcf7_form_tag', $scanned_tag, $replace );
226
+
227
+ $this->scanned_tags[] = $scanned_tag;
228
+
229
+ if ( $replace ) {
230
+ $func = $this->tags[$tag]['function'];
231
+ return $m[1] . call_user_func( $func, $scanned_tag ) . $m[6];
232
+ } else {
233
+ return $m[0];
234
+ }
235
+ }
236
+
237
+ private function parse_atts( $text ) {
238
+ $atts = array( 'options' => array(), 'values' => array() );
239
+ $text = preg_replace( "/[\x{00a0}\x{200b}]+/u", " ", $text );
240
+ $text = stripcslashes( trim( $text ) );
241
+
242
+ $pattern = '%^([-+*=0-9a-zA-Z:.!?#$&@_/|\%\r\n\t ]*?)((?:[\r\n\t ]*"[^"]*"|[\r\n\t ]*\'[^\']*\')*)$%';
243
+
244
+ if ( preg_match( $pattern, $text, $match ) ) {
245
+ if ( ! empty( $match[1] ) ) {
246
+ $atts['options'] = preg_split( '/[\r\n\t ]+/', trim( $match[1] ) );
247
+ }
248
+
249
+ if ( ! empty( $match[2] ) ) {
250
+ preg_match_all( '/"[^"]*"|\'[^\']*\'/', $match[2], $matched_values );
251
+ $atts['values'] = wpcf7_strip_quote_deep( $matched_values[0] );
252
+ }
253
+ } else {
254
+ $atts = $text;
255
+ }
256
+
257
+ return $atts;
258
+ }
259
+ }
includes/formatting.php CHANGED
@@ -13,8 +13,9 @@ function wpcf7_autop( $pee, $br = 1 ) {
13
  $pee = preg_replace( '!(<' . $allblocks . '[^>]*>)!', "\n$1", $pee );
14
  $pee = preg_replace( '!(</' . $allblocks . '>)!', "$1\n\n", $pee );
15
 
16
- /* wpcf7: take care of [response] and [recaptcha] tag */
17
- $pee = preg_replace( '!(\[(?:response|recaptcha)[^]]*\])!',
 
18
  "\n$1\n\n", $pee );
19
 
20
  $pee = str_replace( array( "\r\n", "\r" ), "\n", $pee ); // cross-platform newlines
@@ -42,10 +43,10 @@ function wpcf7_autop( $pee, $br = 1 ) {
42
  $pee = preg_replace( '!<p>\s*(</?' . $allblocks . '[^>]*>)!', "$1", $pee );
43
  $pee = preg_replace( '!(</?' . $allblocks . '[^>]*>)\s*</p>!', "$1", $pee );
44
 
45
- /* wpcf7: take care of [response] and [recaptcha] tag */
46
- $pee = preg_replace( '!<p>\s*(\[(?:response|recaptcha)[^]]*\])!',
47
  "$1", $pee );
48
- $pee = preg_replace( '!(\[(?:response|recaptcha)[^]]*\])\s*</p>!',
49
  "$1", $pee );
50
 
51
  if ( $br ) {
@@ -82,36 +83,41 @@ function wpcf7_sanitize_query_var( $text ) {
82
  function wpcf7_strip_quote( $text ) {
83
  $text = trim( $text );
84
 
85
- if ( preg_match( '/^"(.*)"$/', $text, $matches ) )
86
  $text = $matches[1];
87
- elseif ( preg_match( "/^'(.*)'$/", $text, $matches ) )
88
  $text = $matches[1];
 
89
 
90
  return $text;
91
  }
92
 
93
  function wpcf7_strip_quote_deep( $arr ) {
94
- if ( is_string( $arr ) )
95
  return wpcf7_strip_quote( $arr );
 
96
 
97
  if ( is_array( $arr ) ) {
98
  $result = array();
99
 
100
- foreach ( $arr as $key => $text )
101
  $result[$key] = wpcf7_strip_quote_deep( $text );
 
102
 
103
  return $result;
104
  }
105
  }
106
 
107
  function wpcf7_normalize_newline( $text, $to = "\n" ) {
108
- if ( ! is_string( $text ) )
109
  return $text;
 
110
 
111
  $nls = array( "\r\n", "\r", "\n" );
112
 
113
- if ( ! in_array( $to, $nls ) )
114
  return $text;
 
115
 
116
  return str_replace( $nls, $to, $text );
117
  }
@@ -120,8 +126,9 @@ function wpcf7_normalize_newline_deep( $arr, $to = "\n" ) {
120
  if ( is_array( $arr ) ) {
121
  $result = array();
122
 
123
- foreach ( $arr as $key => $text )
124
  $result[$key] = wpcf7_normalize_newline_deep( $text, $to );
 
125
 
126
  return $result;
127
  }
@@ -189,8 +196,9 @@ function wpcf7_is_number( $number ) {
189
  function wpcf7_is_date( $date ) {
190
  $result = preg_match( '/^([0-9]{4,})-([0-9]{2})-([0-9]{2})$/', $date, $matches );
191
 
192
- if ( $result )
193
  $result = checkdate( $matches[2], $matches[3], $matches[1] );
 
194
 
195
  return apply_filters( 'wpcf7_is_date', $result, $date );
196
  }
13
  $pee = preg_replace( '!(<' . $allblocks . '[^>]*>)!', "\n$1", $pee );
14
  $pee = preg_replace( '!(</' . $allblocks . '>)!', "$1\n\n", $pee );
15
 
16
+ /* wpcf7: take care of [response], [recaptcha], and [hidden] tags */
17
+ $block_hidden_form_tags = '(?:response|recaptcha|hidden)';
18
+ $pee = preg_replace( '!(\[' . $block_hidden_form_tags . '[^]]*\])!',
19
  "\n$1\n\n", $pee );
20
 
21
  $pee = str_replace( array( "\r\n", "\r" ), "\n", $pee ); // cross-platform newlines
43
  $pee = preg_replace( '!<p>\s*(</?' . $allblocks . '[^>]*>)!', "$1", $pee );
44
  $pee = preg_replace( '!(</?' . $allblocks . '[^>]*>)\s*</p>!', "$1", $pee );
45
 
46
+ /* wpcf7: take care of [response], [recaptcha], and [hidden] tag */
47
+ $pee = preg_replace( '!<p>\s*(\[' . $block_hidden_form_tags . '[^]]*\])!',
48
  "$1", $pee );
49
+ $pee = preg_replace( '!(\[' . $block_hidden_form_tags . '[^]]*\])\s*</p>!',
50
  "$1", $pee );
51
 
52
  if ( $br ) {
83
  function wpcf7_strip_quote( $text ) {
84
  $text = trim( $text );
85
 
86
+ if ( preg_match( '/^"(.*)"$/s', $text, $matches ) ) {
87
  $text = $matches[1];
88
+ } elseif ( preg_match( "/^'(.*)'$/s", $text, $matches ) ) {
89
  $text = $matches[1];
90
+ }
91
 
92
  return $text;
93
  }
94
 
95
  function wpcf7_strip_quote_deep( $arr ) {
96
+ if ( is_string( $arr ) ) {
97
  return wpcf7_strip_quote( $arr );
98
+ }
99
 
100
  if ( is_array( $arr ) ) {
101
  $result = array();
102
 
103
+ foreach ( $arr as $key => $text ) {
104
  $result[$key] = wpcf7_strip_quote_deep( $text );
105
+ }
106
 
107
  return $result;
108
  }
109
  }
110
 
111
  function wpcf7_normalize_newline( $text, $to = "\n" ) {
112
+ if ( ! is_string( $text ) ) {
113
  return $text;
114
+ }
115
 
116
  $nls = array( "\r\n", "\r", "\n" );
117
 
118
+ if ( ! in_array( $to, $nls ) ) {
119
  return $text;
120
+ }
121
 
122
  return str_replace( $nls, $to, $text );
123
  }
126
  if ( is_array( $arr ) ) {
127
  $result = array();
128
 
129
+ foreach ( $arr as $key => $text ) {
130
  $result[$key] = wpcf7_normalize_newline_deep( $text, $to );
131
+ }
132
 
133
  return $result;
134
  }
196
  function wpcf7_is_date( $date ) {
197
  $result = preg_match( '/^([0-9]{4,})-([0-9]{2})-([0-9]{2})$/', $date, $matches );
198
 
199
+ if ( $result ) {
200
  $result = checkdate( $matches[2], $matches[3], $matches[1] );
201
+ }
202
 
203
  return apply_filters( 'wpcf7_is_date', $result, $date );
204
  }
includes/functions.php CHANGED
@@ -15,26 +15,21 @@ function wpcf7_plugin_url( $path = '' ) {
15
  }
16
 
17
  function wpcf7_upload_dir( $type = false ) {
18
- $uploads = wp_upload_dir();
19
 
20
  $uploads = apply_filters( 'wpcf7_upload_dir', array(
21
  'dir' => $uploads['basedir'],
22
  'url' => $uploads['baseurl'] ) );
23
 
24
- if ( 'dir' == $type )
25
  return $uploads['dir'];
26
- if ( 'url' == $type )
27
  return $uploads['url'];
 
28
 
29
  return $uploads;
30
  }
31
 
32
- function wpcf7_ajax_loader() {
33
- $url = wpcf7_plugin_url( 'images/ajax-loader.gif' );
34
-
35
- return apply_filters( 'wpcf7_ajax_loader', $url );
36
- }
37
-
38
  function wpcf7_verify_nonce( $nonce, $action = -1 ) {
39
  if ( substr( wp_hash( $action, 'nonce' ), -12, 10 ) == $nonce )
40
  return true;
@@ -347,3 +342,15 @@ function wpcf7_is_localhost() {
347
  $server_name = strtolower( $_SERVER['SERVER_NAME'] );
348
  return in_array( $server_name, array( 'localhost', '127.0.0.1' ) );
349
  }
 
 
 
 
 
 
 
 
 
 
 
 
15
  }
16
 
17
  function wpcf7_upload_dir( $type = false ) {
18
+ $uploads = wp_get_upload_dir();
19
 
20
  $uploads = apply_filters( 'wpcf7_upload_dir', array(
21
  'dir' => $uploads['basedir'],
22
  'url' => $uploads['baseurl'] ) );
23
 
24
+ if ( 'dir' == $type ) {
25
  return $uploads['dir'];
26
+ } if ( 'url' == $type ) {
27
  return $uploads['url'];
28
+ }
29
 
30
  return $uploads;
31
  }
32
 
 
 
 
 
 
 
33
  function wpcf7_verify_nonce( $nonce, $action = -1 ) {
34
  if ( substr( wp_hash( $action, 'nonce' ), -12, 10 ) == $nonce )
35
  return true;
342
  $server_name = strtolower( $_SERVER['SERVER_NAME'] );
343
  return in_array( $server_name, array( 'localhost', '127.0.0.1' ) );
344
  }
345
+
346
+ function wpcf7_deprecated_function( $function, $version, $replacement ) {
347
+ $trigger_error = apply_filters( 'deprecated_function_trigger_error', true );
348
+
349
+ if ( WP_DEBUG && $trigger_error ) {
350
+ if ( function_exists( '__' ) ) {
351
+ trigger_error( sprintf( __( '%1$s is <strong>deprecated</strong> since Contact Form 7 version %2$s! Use %3$s instead.', 'contact-form-7' ), $function, $version, $replacement ) );
352
+ } else {
353
+ trigger_error( sprintf( '%1$s is <strong>deprecated</strong> since Contact Form 7 version %2$s! Use %3$s instead.', $function, $version, $replacement ) );
354
+ }
355
+ }
356
+ }
includes/js/scripts.js CHANGED
@@ -15,7 +15,7 @@
15
  beforeSubmit: function(arr, $form, options) {
16
  $form.wpcf7ClearResponseOutput();
17
  $form.find('[aria-invalid]').attr('aria-invalid', 'false');
18
- $form.find('img.ajax-loader').css({ visibility: 'visible' });
19
  return true;
20
  },
21
  beforeSerialize: function($form, options) {
@@ -199,11 +199,7 @@
199
 
200
  $.fn.wpcf7AjaxLoader = function() {
201
  return this.each(function() {
202
- var loader = $('<img class="ajax-loader" />')
203
- .attr({ src: _wpcf7.loaderUrl, alt: _wpcf7.sending })
204
- .css('visibility', 'hidden');
205
-
206
- $(this).after(loader);
207
  });
208
  };
209
 
@@ -394,7 +390,7 @@
394
  return this.each(function() {
395
  $(this).find('div.wpcf7-response-output').hide().empty().removeClass('wpcf7-mail-sent-ok wpcf7-mail-sent-ng wpcf7-validation-errors wpcf7-spam-blocked').removeAttr('role');
396
  $(this).find('span.wpcf7-not-valid-tip').remove();
397
- $(this).find('img.ajax-loader').css({ visibility: 'hidden' });
398
  });
399
  };
400
 
15
  beforeSubmit: function(arr, $form, options) {
16
  $form.wpcf7ClearResponseOutput();
17
  $form.find('[aria-invalid]').attr('aria-invalid', 'false');
18
+ $form.find('.ajax-loader').addClass('is-active');
19
  return true;
20
  },
21
  beforeSerialize: function($form, options) {
199
 
200
  $.fn.wpcf7AjaxLoader = function() {
201
  return this.each(function() {
202
+ $(this).after('<span class="ajax-loader"></span>');
 
 
 
 
203
  });
204
  };
205
 
390
  return this.each(function() {
391
  $(this).find('div.wpcf7-response-output').hide().empty().removeClass('wpcf7-mail-sent-ok wpcf7-mail-sent-ng wpcf7-validation-errors wpcf7-spam-blocked').removeAttr('role');
392
  $(this).find('span.wpcf7-not-valid-tip').remove();
393
+ $(this).find('.ajax-loader').removeClass('is-active');
394
  });
395
  };
396
 
includes/mail.php CHANGED
@@ -6,61 +6,87 @@ class WPCF7_Mail {
6
 
7
  private $name = '';
8
  private $template = array();
 
 
9
 
10
- public static function send( $template, $name = '' ) {
11
- $instance = new self;
12
- $instance->name = trim( $name );
13
- $instance->setup_template( $template );
14
-
15
- self::$current = $instance;
16
-
17
- return $instance->compose();
18
  }
19
 
20
- private function __construct() {}
21
-
22
- public function name() {
23
- return $this->name;
24
  }
25
 
26
- public static function get_current() {
27
- return self::$current;
28
- }
 
29
 
30
- private function setup_template( $template ) {
31
- $defaults = array(
32
  'subject' => '', 'sender' => '', 'body' => '',
33
  'recipient' => '', 'additional_headers' => '',
34
- 'attachments' => '', 'use_html' => false,
35
- 'exclude_blank' => false );
36
 
37
- $this->template = wp_parse_args( $template, $defaults );
 
38
  }
39
 
40
- private function compose( $send = true ) {
 
41
  $template = $this->template;
42
- $use_html = (bool) $template['use_html'];
43
 
44
- $subject = $this->replace_tags( $template['subject'] );
45
- $sender = $this->replace_tags( $template['sender'] );
46
- $recipient = $this->replace_tags( $template['recipient'] );
47
- $additional_headers = $this->replace_tags( $template['additional_headers'] );
48
 
49
- if ( $use_html ) {
50
- $body = $this->replace_tags( $template['body'], true );
51
- $body = wpautop( $body );
52
- } else {
53
- $body = $this->replace_tags( $template['body'] );
 
54
  }
55
 
56
- $attachments = $this->attachments( $template['attachments'] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
 
58
- $components = compact( 'subject', 'sender', 'body',
59
- 'recipient', 'additional_headers', 'attachments' );
 
 
 
 
 
 
60
 
61
  $components = apply_filters( 'wpcf7_mail_components',
62
  $components, wpcf7_get_current_contact_form(), $this );
63
 
 
 
 
 
64
  $subject = wpcf7_strip_newline( $components['subject'] );
65
  $sender = wpcf7_strip_newline( $components['sender'] );
66
  $recipient = wpcf7_strip_newline( $components['recipient'] );
@@ -70,7 +96,7 @@ class WPCF7_Mail {
70
 
71
  $headers = "From: $sender\n";
72
 
73
- if ( $use_html ) {
74
  $headers .= "Content-Type: text/html\n";
75
  $headers .= "X-WPCF7-Content-Type: text/html\n";
76
  } else {
@@ -81,25 +107,22 @@ class WPCF7_Mail {
81
  $headers .= $additional_headers . "\n";
82
  }
83
 
84
- if ( $send ) {
85
- return wp_mail( $recipient, $subject, $body, $headers, $attachments );
86
- }
87
-
88
- $components = compact( 'subject', 'sender', 'body',
89
- 'recipient', 'headers', 'attachments' );
90
-
91
- return $components;
92
  }
93
 
94
  public function replace_tags( $content, $html = false ) {
95
  $args = array(
96
  'html' => $html,
97
- 'exclude_blank' => $this->template['exclude_blank'] );
98
 
99
  return wpcf7_mail_replace_tags( $content, $args );
100
  }
101
 
102
- private function attachments( $template ) {
 
 
 
 
103
  $attachments = array();
104
 
105
  if ( $submission = WPCF7_Submission::get_instance() ) {
@@ -402,5 +425,3 @@ function wpcf7_special_mail_tag( $output, $name, $html ) {
402
 
403
  return $output;
404
  }
405
-
406
- ?>
6
 
7
  private $name = '';
8
  private $template = array();
9
+ private $use_html = false;
10
+ private $exclude_blank = false;
11
 
12
+ public static function get_current() {
13
+ return self::$current;
 
 
 
 
 
 
14
  }
15
 
16
+ public static function send( $template, $name = '' ) {
17
+ self::$current = new self( $name, $template );
18
+ return self::$current->compose();
 
19
  }
20
 
21
+ private function __construct( $name, $template ) {
22
+ $this->name = trim( $name );
23
+ $this->use_html = ! empty( $template['use_html'] );
24
+ $this->exclude_blank = ! empty( $template['exclude_blank'] );
25
 
26
+ $this->template = wp_parse_args( $template, array(
 
27
  'subject' => '', 'sender' => '', 'body' => '',
28
  'recipient' => '', 'additional_headers' => '',
29
+ 'attachments' => '' ) );
30
+ }
31
 
32
+ public function name() {
33
+ return $this->name;
34
  }
35
 
36
+ public function get( $component, $replace_tags = false ) {
37
+ $use_html = ( $this->use_html && 'body' == $component );
38
  $template = $this->template;
39
+ $component = isset( $template[$component] ) ? $template[$component] : '';
40
 
41
+ if ( $replace_tags ) {
42
+ if ( $use_html ) {
43
+ $component = $this->replace_tags( $component, true );
 
44
 
45
+ if ( ! preg_match( '%<html[>\s].*</html>%is', $component ) ) {
46
+ $component = $this->htmlize( $component );
47
+ }
48
+ } else {
49
+ $component = $this->replace_tags( $component );
50
+ }
51
  }
52
 
53
+ return $component;
54
+ }
55
+
56
+ private function htmlize( $body ) {
57
+ $header = apply_filters( 'wpcf7_mail_html_header',
58
+ '<!doctype html>
59
+ <html xmlns="http://www.w3.org/1999/xhtml">
60
+ <head>
61
+ <title>' . esc_html( $this->get( 'subject', true ) ) . '</title>
62
+ </head>
63
+ <body>
64
+ ', $this );
65
+
66
+ $footer = apply_filters( 'wpcf7_mail_html_footer',
67
+ '</body>
68
+ </html>', $this );
69
+
70
+ $html = $header . wpautop( $body ) . $footer;
71
+ return $html;
72
+ }
73
 
74
+ private function compose( $send = true ) {
75
+ $components = array(
76
+ 'subject' => $this->get( 'subject', true ),
77
+ 'sender' => $this->get( 'sender', true ),
78
+ 'body' => $this->get( 'body', true ),
79
+ 'recipient' => $this->get( 'recipient', true ),
80
+ 'additional_headers' => $this->get( 'additional_headers', true ),
81
+ 'attachments' => $this->attachments() );
82
 
83
  $components = apply_filters( 'wpcf7_mail_components',
84
  $components, wpcf7_get_current_contact_form(), $this );
85
 
86
+ if ( ! $send ) {
87
+ return $components;
88
+ }
89
+
90
  $subject = wpcf7_strip_newline( $components['subject'] );
91
  $sender = wpcf7_strip_newline( $components['sender'] );
92
  $recipient = wpcf7_strip_newline( $components['recipient'] );
96
 
97
  $headers = "From: $sender\n";
98
 
99
+ if ( $this->use_html ) {
100
  $headers .= "Content-Type: text/html\n";
101
  $headers .= "X-WPCF7-Content-Type: text/html\n";
102
  } else {
107
  $headers .= $additional_headers . "\n";
108
  }
109
 
110
+ return wp_mail( $recipient, $subject, $body, $headers, $attachments );
 
 
 
 
 
 
 
111
  }
112
 
113
  public function replace_tags( $content, $html = false ) {
114
  $args = array(
115
  'html' => $html,
116
+ 'exclude_blank' => $this->exclude_blank );
117
 
118
  return wpcf7_mail_replace_tags( $content, $args );
119
  }
120
 
121
+ private function attachments( $template = null ) {
122
+ if ( ! $template ) {
123
+ $template = $this->get( 'attachments' );
124
+ }
125
+
126
  $attachments = array();
127
 
128
  if ( $submission = WPCF7_Submission::get_instance() ) {
425
 
426
  return $output;
427
  }
 
 
includes/pipe.php CHANGED
@@ -69,11 +69,10 @@ class WPCF7_Pipes {
69
  }
70
 
71
  public function random_pipe() {
72
- if ( $this->zero() )
73
  return null;
 
74
 
75
  return $this->pipes[array_rand( $this->pipes )];
76
  }
77
  }
78
-
79
- ?>
69
  }
70
 
71
  public function random_pipe() {
72
+ if ( $this->zero() ) {
73
  return null;
74
+ }
75
 
76
  return $this->pipes[array_rand( $this->pipes )];
77
  }
78
  }
 
 
includes/shortcodes.php CHANGED
@@ -1,514 +1,101 @@
1
  <?php
2
-
3
- class WPCF7_ShortcodeManager {
4
-
5
- private static $instance;
6
-
7
- private $shortcode_tags = array();
8
-
9
- // Taggs scanned at the last time of do_shortcode()
10
- private $scanned_tags = null;
11
-
12
- // Executing shortcodes (true) or just scanning (false)
13
- private $exec = true;
14
-
15
- private function __construct() {}
16
-
17
- public static function get_instance() {
18
- if ( empty( self::$instance ) ) {
19
- self::$instance = new self;
20
- }
21
-
22
- return self::$instance;
23
- }
24
-
25
- public function get_scanned_tags() {
26
- return $this->scanned_tags;
27
- }
28
-
29
- public function add_shortcode( $tag, $func, $has_name = false ) {
30
- if ( ! is_callable( $func ) )
31
- return;
32
-
33
- $tags = array_filter( array_unique( (array) $tag ) );
34
-
35
- foreach ( $tags as $tag ) {
36
- $tag = $this->sanitize_tag_type( $tag );
37
-
38
- $this->shortcode_tags[$tag] = array(
39
- 'function' => $func,
40
- 'has_name' => (boolean) $has_name );
41
- }
42
- }
43
-
44
- private function sanitize_tag_type( $tag ) {
45
- $tag = preg_replace( '/[^a-zA-Z0-9_*]+/', '_', $tag );
46
- $tag = rtrim( $tag, '_' );
47
- $tag = strtolower( $tag );
48
- return $tag;
49
- }
50
-
51
- public function remove_shortcode( $tag ) {
52
- unset( $this->shortcode_tags[$tag] );
53
- }
54
-
55
- public function normalize_shortcode( $content ) {
56
- if ( empty( $this->shortcode_tags ) || ! is_array( $this->shortcode_tags ) )
57
- return $content;
58
-
59
- $pattern = $this->get_shortcode_regex();
60
- return preg_replace_callback( '/' . $pattern . '/s',
61
- array( $this, 'normalize_space_cb' ), $content );
62
- }
63
-
64
- private function normalize_space_cb( $m ) {
65
- // allow [[foo]] syntax for escaping a tag
66
- if ( $m[1] == '[' && $m[6] == ']' )
67
- return $m[0];
68
-
69
- $tag = $m[2];
70
- $attr = trim( preg_replace( '/[\r\n\t ]+/', ' ', $m[3] ) );
71
- $content = trim( $m[5] );
72
-
73
- $content = str_replace( "\n", '<WPPreserveNewline />', $content );
74
-
75
- $result = $m[1] . '[' . $tag
76
- . ( $attr ? ' ' . $attr : '' )
77
- . ( $m[4] ? ' ' . $m[4] : '' )
78
- . ']'
79
- . ( $content ? $content . '[/' . $tag . ']' : '' )
80
- . $m[6];
81
-
82
- return $result;
83
- }
84
-
85
- public function do_shortcode( $content, $exec = true ) {
86
- $this->exec = (bool) $exec;
87
- $this->scanned_tags = array();
88
-
89
- if ( empty( $this->shortcode_tags ) || ! is_array( $this->shortcode_tags ) )
90
- return $content;
91
-
92
- $pattern = $this->get_shortcode_regex();
93
- return preg_replace_callback( '/' . $pattern . '/s',
94
- array( $this, 'do_shortcode_tag' ), $content );
95
- }
96
-
97
- public function scan_shortcode( $content ) {
98
- $this->do_shortcode( $content, false );
99
- return $this->scanned_tags;
100
- }
101
-
102
- private function get_shortcode_regex() {
103
- $tagnames = array_keys( $this->shortcode_tags );
104
- $tagregexp = join( '|', array_map( 'preg_quote', $tagnames ) );
105
-
106
- return '(\[?)'
107
- . '\[(' . $tagregexp . ')(?:[\r\n\t ](.*?))?(?:[\r\n\t ](\/))?\]'
108
- . '(?:([^[]*?)\[\/\2\])?'
109
- . '(\]?)';
110
- }
111
-
112
- private function do_shortcode_tag( $m ) {
113
- // allow [[foo]] syntax for escaping a tag
114
- if ( $m[1] == '[' && $m[6] == ']' ) {
115
- return substr( $m[0], 1, -1 );
116
- }
117
-
118
- $tag = $m[2];
119
- $attr = $this->shortcode_parse_atts( $m[3] );
120
-
121
- $scanned_tag = array(
122
- 'type' => $tag,
123
- 'basetype' => trim( $tag, '*' ),
124
- 'name' => '',
125
- 'options' => array(),
126
- 'raw_values' => array(),
127
- 'values' => array(),
128
- 'pipes' => null,
129
- 'labels' => array(),
130
- 'attr' => '',
131
- 'content' => '' );
132
-
133
- if ( is_array( $attr ) ) {
134
- if ( is_array( $attr['options'] ) ) {
135
- if ( $this->shortcode_tags[$tag]['has_name'] && ! empty( $attr['options'] ) ) {
136
- $scanned_tag['name'] = array_shift( $attr['options'] );
137
-
138
- if ( ! wpcf7_is_name( $scanned_tag['name'] ) )
139
- return $m[0]; // Invalid name is used. Ignore this tag.
140
- }
141
-
142
- $scanned_tag['options'] = (array) $attr['options'];
143
- }
144
-
145
- $scanned_tag['raw_values'] = (array) $attr['values'];
146
-
147
- if ( WPCF7_USE_PIPE ) {
148
- $pipes = new WPCF7_Pipes( $scanned_tag['raw_values'] );
149
- $scanned_tag['values'] = $pipes->collect_befores();
150
- $scanned_tag['pipes'] = $pipes;
151
- } else {
152
- $scanned_tag['values'] = $scanned_tag['raw_values'];
153
- }
154
-
155
- $scanned_tag['labels'] = $scanned_tag['values'];
156
-
157
- } else {
158
- $scanned_tag['attr'] = $attr;
159
- }
160
-
161
- $scanned_tag['values'] = array_map( 'trim', $scanned_tag['values'] );
162
- $scanned_tag['labels'] = array_map( 'trim', $scanned_tag['labels'] );
163
-
164
- $content = trim( $m[5] );
165
- $content = preg_replace( "/<br[\r\n\t ]*\/?>$/m", '', $content );
166
- $scanned_tag['content'] = $content;
167
-
168
- $scanned_tag = apply_filters( 'wpcf7_form_tag', $scanned_tag, $this->exec );
169
-
170
- $this->scanned_tags[] = $scanned_tag;
171
-
172
- if ( $this->exec ) {
173
- $func = $this->shortcode_tags[$tag]['function'];
174
- return $m[1] . call_user_func( $func, $scanned_tag ) . $m[6];
175
- } else {
176
- return $m[0];
177
- }
178
- }
179
-
180
- private function shortcode_parse_atts( $text ) {
181
- $atts = array( 'options' => array(), 'values' => array() );
182
- $text = preg_replace( "/[\x{00a0}\x{200b}]+/u", " ", $text );
183
- $text = stripcslashes( trim( $text ) );
184
-
185
- $pattern = '%^([-+*=0-9a-zA-Z:.!?#$&@_/|\%\r\n\t ]*?)((?:[\r\n\t ]*"[^"]*"|[\r\n\t ]*\'[^\']*\')*)$%';
186
-
187
- if ( preg_match( $pattern, $text, $match ) ) {
188
- if ( ! empty( $match[1] ) ) {
189
- $atts['options'] = preg_split( '/[\r\n\t ]+/', trim( $match[1] ) );
190
- }
191
- if ( ! empty( $match[2] ) ) {
192
- preg_match_all( '/"[^"]*"|\'[^\']*\'/', $match[2], $matched_values );
193
- $atts['values'] = wpcf7_strip_quote_deep( $matched_values[0] );
194
- }
195
- } else {
196
- $atts = $text;
197
- }
198
-
199
- return $atts;
200
- }
201
-
202
- }
203
 
204
  function wpcf7_add_shortcode( $tag, $func, $has_name = false ) {
205
- $manager = WPCF7_ShortcodeManager::get_instance();
206
 
207
- return $manager->add_shortcode( $tag, $func, $has_name );
208
  }
209
 
210
  function wpcf7_remove_shortcode( $tag ) {
211
- $manager = WPCF7_ShortcodeManager::get_instance();
212
 
213
- return $manager->remove_shortcode( $tag );
214
  }
215
 
216
  function wpcf7_do_shortcode( $content ) {
217
- $manager = WPCF7_ShortcodeManager::get_instance();
 
218
 
219
- return $manager->do_shortcode( $content );
220
  }
221
 
222
- class WPCF7_Shortcode {
223
-
224
- public $type;
225
- public $basetype;
226
- public $name = '';
227
- public $options = array();
228
- public $raw_values = array();
229
- public $values = array();
230
- public $pipes;
231
- public $labels = array();
232
- public $attr = '';
233
- public $content = '';
234
 
235
- public function __construct( $tag ) {
236
- foreach ( $tag as $key => $value ) {
237
- if ( property_exists( __CLASS__, $key ) )
238
- $this->{$key} = $value;
239
- }
240
- }
241
-
242
- public function is_required() {
243
- return ( '*' == substr( $this->type, -1 ) );
244
- }
245
-
246
- public function has_option( $opt ) {
247
- $pattern = sprintf( '/^%s(:.+)?$/i', preg_quote( $opt, '/' ) );
248
- return (bool) preg_grep( $pattern, $this->options );
249
- }
250
-
251
- public function get_option( $opt, $pattern = '', $single = false ) {
252
- $preset_patterns = array(
253
- 'date' => '([0-9]{4}-[0-9]{2}-[0-9]{2}|today(.*))',
254
- 'int' => '[0-9]+',
255
- 'signed_int' => '-?[0-9]+',
256
- 'class' => '[-0-9a-zA-Z_]+',
257
- 'id' => '[-0-9a-zA-Z_]+' );
258
-
259
- if ( isset( $preset_patterns[$pattern] ) )
260
- $pattern = $preset_patterns[$pattern];
261
-
262
- if ( '' == $pattern )
263
- $pattern = '.+';
264
-
265
- $pattern = sprintf( '/^%s:%s$/i', preg_quote( $opt, '/' ), $pattern );
266
-
267
- if ( $single ) {
268
- $matches = $this->get_first_match_option( $pattern );
269
-
270
- if ( ! $matches )
271
- return false;
272
-
273
- return substr( $matches[0], strlen( $opt ) + 1 );
274
- } else {
275
- $matches_a = $this->get_all_match_options( $pattern );
276
-
277
- if ( ! $matches_a )
278
- return false;
279
-
280
- $results = array();
281
-
282
- foreach ( $matches_a as $matches )
283
- $results[] = substr( $matches[0], strlen( $opt ) + 1 );
284
-
285
- return $results;
286
- }
287
- }
288
-
289
- public function get_id_option() {
290
- return $this->get_option( 'id', 'id', true );
291
- }
292
-
293
- public function get_class_option( $default = '' ) {
294
- if ( is_string( $default ) )
295
- $default = explode( ' ', $default );
296
-
297
- $options = array_merge(
298
- (array) $default,
299
- (array) $this->get_option( 'class', 'class' ) );
300
-
301
- $options = array_filter( array_unique( $options ) );
302
-
303
- return implode( ' ', $options );
304
- }
305
-
306
- public function get_size_option( $default = '' ) {
307
- $option = $this->get_option( 'size', 'int', true );
308
-
309
- if ( $option ) {
310
- return $option;
311
- }
312
-
313
- $matches_a = $this->get_all_match_options( '%^([0-9]*)/[0-9]*$%' );
314
-
315
- foreach ( (array) $matches_a as $matches ) {
316
- if ( isset( $matches[1] ) && '' !== $matches[1] )
317
- return $matches[1];
318
- }
319
-
320
- return $default;
321
- }
322
 
323
- public function get_maxlength_option( $default = '' ) {
324
- $option = $this->get_option( 'maxlength', 'int', true );
325
 
326
- if ( $option ) {
327
- return $option;
328
- }
329
 
330
- $matches_a = $this->get_all_match_options(
331
- '%^(?:[0-9]*x?[0-9]*)?/([0-9]+)$%' );
332
 
333
- foreach ( (array) $matches_a as $matches ) {
334
- if ( isset( $matches[1] ) && '' !== $matches[1] )
335
- return $matches[1];
336
- }
337
 
338
- return $default;
 
339
  }
340
 
341
- public function get_minlength_option( $default = '' ) {
342
- $option = $this->get_option( 'minlength', 'int', true );
 
343
 
344
- if ( $option ) {
345
- return $option;
346
- } else {
347
- return $default;
348
- }
349
  }
350
 
351
- public function get_cols_option( $default = '' ) {
352
- $option = $this->get_option( 'cols', 'int', true );
353
-
354
- if ( $option ) {
355
- return $option;
356
- }
357
-
358
- $matches_a = $this->get_all_match_options(
359
- '%^([0-9]*)x([0-9]*)(?:/[0-9]+)?$%' );
360
-
361
- foreach ( (array) $matches_a as $matches ) {
362
- if ( isset( $matches[1] ) && '' !== $matches[1] )
363
- return $matches[1];
364
- }
365
 
366
- return $default;
367
  }
368
 
369
- public function get_rows_option( $default = '' ) {
370
- $option = $this->get_option( 'rows', 'int', true );
371
-
372
- if ( $option ) {
373
- return $option;
374
- }
375
-
376
- $matches_a = $this->get_all_match_options(
377
- '%^([0-9]*)x([0-9]*)(?:/[0-9]+)?$%' );
378
-
379
- foreach ( (array) $matches_a as $matches ) {
380
- if ( isset( $matches[2] ) && '' !== $matches[2] )
381
- return $matches[2];
382
- }
383
 
384
- return $default;
385
  }
386
 
387
- public function get_date_option( $opt ) {
388
- $option = $this->get_option( $opt, 'date', true );
389
-
390
- if ( preg_match( '/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/', $option ) ) {
391
- return $option;
392
- }
393
-
394
- if ( preg_match( '/^today(?:([+-][0-9]+)([a-z]*))?/', $option, $matches ) ) {
395
- $number = isset( $matches[1] ) ? (int) $matches[1] : 0;
396
- $unit = isset( $matches[2] ) ? $matches[2] : '';
397
-
398
- if ( ! preg_match( '/^(day|month|year|week)s?$/', $unit ) ) {
399
- $unit = 'days';
400
- }
401
-
402
- $date = gmdate( 'Y-m-d',
403
- strtotime( sprintf( 'today %1$s %2$s', $number, $unit ) ) );
404
- return $date;
405
- }
406
 
407
- return false;
408
  }
409
 
410
- public function get_default_option( $default = '', $args = '' ) {
411
- $args = wp_parse_args( $args, array(
412
- 'multiple' => false ) );
413
-
414
- $options = (array) $this->get_option( 'default' );
415
- $values = array();
416
-
417
- if ( empty( $options ) ) {
418
- return $args['multiple'] ? $values : $default;
419
- }
420
-
421
- foreach ( $options as $opt ) {
422
- $opt = sanitize_key( $opt );
423
-
424
- if ( 'user_' == substr( $opt, 0, 5 ) && is_user_logged_in() ) {
425
- $primary_props = array( 'user_login', 'user_email', 'user_url' );
426
- $opt = in_array( $opt, $primary_props ) ? $opt : substr( $opt, 5 );
427
-
428
- $user = wp_get_current_user();
429
- $user_prop = $user->get( $opt );
430
-
431
- if ( ! empty( $user_prop ) ) {
432
- if ( $args['multiple'] ) {
433
- $values[] = $user_prop;
434
- } else {
435
- return $user_prop;
436
- }
437
- }
438
-
439
- } elseif ( 'post_meta' == $opt && in_the_loop() ) {
440
- if ( $args['multiple'] ) {
441
- $values = array_merge( $values,
442
- get_post_meta( get_the_ID(), $this->name ) );
443
- } else {
444
- $val = (string) get_post_meta( get_the_ID(), $this->name, true );
445
-
446
- if ( strlen( $val ) ) {
447
- return $val;
448
- }
449
- }
450
-
451
- } elseif ( 'get' == $opt && isset( $_GET[$this->name] ) ) {
452
- $vals = (array) $_GET[$this->name];
453
- $vals = array_map( 'wpcf7_sanitize_query_var', $vals );
454
-
455
- if ( $args['multiple'] ) {
456
- $values = array_merge( $values, $vals );
457
- } else {
458
- $val = isset( $vals[0] ) ? (string) $vals[0] : '';
459
-
460
- if ( strlen( $val ) ) {
461
- return $val;
462
- }
463
- }
464
-
465
- } elseif ( 'post' == $opt && isset( $_POST[$this->name] ) ) {
466
- $vals = (array) $_POST[$this->name];
467
- $vals = array_map( 'wpcf7_sanitize_query_var', $vals );
468
-
469
- if ( $args['multiple'] ) {
470
- $values = array_merge( $values, $vals );
471
- } else {
472
- $val = isset( $vals[0] ) ? (string) $vals[0] : '';
473
-
474
- if ( strlen( $val ) ) {
475
- return $val;
476
- }
477
- }
478
- }
479
- }
480
 
481
- if ( $args['multiple'] ) {
482
- $values = array_unique( $values );
483
- return $values;
484
  } else {
485
- return $default;
486
  }
487
  }
488
 
489
- public function get_data_option( $args = '' ) {
490
- $options = (array) $this->get_option( 'data' );
491
-
492
- return apply_filters( 'wpcf7_form_tag_data_option', null, $options, $args );
493
- }
494
-
495
- public function get_first_match_option( $pattern ) {
496
- foreach( (array) $this->options as $option ) {
497
- if ( preg_match( $pattern, $option, $matches ) )
498
- return $matches;
499
- }
500
 
501
- return false;
502
  }
 
503
 
504
- public function get_all_match_options( $pattern ) {
505
- $result = array();
506
 
507
- foreach( (array) $this->options as $option ) {
508
- if ( preg_match( $pattern, $option, $matches ) )
509
- $result[] = $matches;
510
- }
511
 
512
- return $result;
513
  }
514
  }
1
  <?php
2
+ /**
3
+ * All the functions and classes in this file are deprecated.
4
+ * You shouldn't use them. The functions and classes will be
5
+ * removed in a later version.
6
+ */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
 
8
  function wpcf7_add_shortcode( $tag, $func, $has_name = false ) {
9
+ wpcf7_deprecated_function( __FUNCTION__, '4.6', 'wpcf7_add_form_tag' );
10
 
11
+ return wpcf7_add_form_tag( $tag, $func, $has_name );
12
  }
13
 
14
  function wpcf7_remove_shortcode( $tag ) {
15
+ wpcf7_deprecated_function( __FUNCTION__, '4.6', 'wpcf7_remove_form_tag' );
16
 
17
+ return wpcf7_remove_form_tag( $tag );
18
  }
19
 
20
  function wpcf7_do_shortcode( $content ) {
21
+ wpcf7_deprecated_function( __FUNCTION__, '4.6',
22
+ 'wpcf7_replace_all_form_tags' );
23
 
24
+ return wpcf7_replace_all_form_tags( $content );
25
  }
26
 
27
+ function wpcf7_scan_shortcode( $cond = null ) {
28
+ wpcf7_deprecated_function( __FUNCTION__, '4.6', 'wpcf7_scan_form_tags' );
 
 
 
 
 
 
 
 
 
 
29
 
30
+ return wpcf7_scan_form_tags( $cond );
31
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
 
33
+ class WPCF7_ShortcodeManager {
 
34
 
35
+ private static $form_tags_manager;
 
 
36
 
37
+ private function __construct() {}
 
38
 
39
+ public static function get_instance() {
40
+ wpcf7_deprecated_function( __METHOD__, '4.6',
41
+ 'WPCF7_FormTagsManager::get_instance' );
 
42
 
43
+ self::$form_tags_manager = WPCF7_FormTagsManager::get_instance();
44
+ return new self;
45
  }
46
 
47
+ public function get_scanned_tags() {
48
+ wpcf7_deprecated_function( __METHOD__, '4.6',
49
+ 'WPCF7_FormTagsManager::get_scanned_tags' );
50
 
51
+ return self::$form_tags_manager->get_scanned_tags();
 
 
 
 
52
  }
53
 
54
+ public function add_shortcode( $tag, $func, $has_name = false ) {
55
+ wpcf7_deprecated_function( __METHOD__, '4.6',
56
+ 'WPCF7_FormTagsManager::add' );
 
 
 
 
 
 
 
 
 
 
 
57
 
58
+ return self::$form_tags_manager->add( $tag, $func, $has_name );
59
  }
60
 
61
+ public function remove_shortcode( $tag ) {
62
+ wpcf7_deprecated_function( __METHOD__, '4.6',
63
+ 'WPCF7_FormTagsManager::remove' );
 
 
 
 
 
 
 
 
 
 
 
64
 
65
+ return self::$form_tags_manager->remove( $tag );
66
  }
67
 
68
+ public function normalize_shortcode( $content ) {
69
+ wpcf7_deprecated_function( __METHOD__, '4.6',
70
+ 'WPCF7_FormTagsManager::normalize' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
 
72
+ return self::$form_tags_manager->normalize( $content );
73
  }
74
 
75
+ public function do_shortcode( $content, $exec = true ) {
76
+ wpcf7_deprecated_function( __METHOD__, '4.6',
77
+ 'WPCF7_FormTagsManager::replace_all' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
 
79
+ if ( $exec ) {
80
+ return self::$form_tags_manager->replace_all( $content );
 
81
  } else {
82
+ return self::$form_tags_manager->scan( $content );
83
  }
84
  }
85
 
86
+ public function scan_shortcode( $content ) {
87
+ wpcf7_deprecated_function( __METHOD__, '4.6',
88
+ 'WPCF7_FormTagsManager::scan' );
 
 
 
 
 
 
 
 
89
 
90
+ return self::$form_tags_manager->scan( $content );
91
  }
92
+ }
93
 
94
+ class WPCF7_Shortcode extends WPCF7_FormTag {
 
95
 
96
+ public function __construct( $tag ) {
97
+ wpcf7_deprecated_function( 'WPCF7_Shortcode', '4.6', 'WPCF7_FormTag' );
 
 
98
 
99
+ parent::__construct( $tag );
100
  }
101
  }
includes/submission.php CHANGED
@@ -74,7 +74,7 @@ class WPCF7_Submission {
74
  $posted_data = array_diff_key( $posted_data, array( '_wpnonce' => '' ) );
75
  $posted_data = $this->sanitize_posted_data( $posted_data );
76
 
77
- $tags = $this->contact_form->form_scan_shortcode();
78
 
79
  foreach ( (array) $tags as $tag ) {
80
  if ( empty( $tag['name'] ) ) {
@@ -131,9 +131,7 @@ class WPCF7_Submission {
131
  }
132
 
133
  $this->meta = array(
134
- 'remote_ip' => isset( $_SERVER['REMOTE_ADDR'] )
135
- ? preg_replace( '/[^0-9a-f.:, ]/', '', $_SERVER['REMOTE_ADDR'] )
136
- : '',
137
  'user_agent' => isset( $_SERVER['HTTP_USER_AGENT'] )
138
  ? substr( $_SERVER['HTTP_USER_AGENT'], 0, 254 ) : '',
139
  'url' => preg_replace( '%(?<!:|/)/.*$%', '',
@@ -174,6 +172,15 @@ class WPCF7_Submission {
174
  return $this->status;
175
  }
176
 
 
 
 
 
 
 
 
 
 
177
  private function validate() {
178
  if ( $this->invalid_fields ) {
179
  return false;
@@ -182,7 +189,7 @@ class WPCF7_Submission {
182
  require_once WPCF7_PLUGIN_DIR . '/includes/validation.php';
183
  $result = new WPCF7_Validation();
184
 
185
- $tags = $this->contact_form->form_scan_shortcode();
186
 
187
  foreach ( $tags as $tag ) {
188
  $result = apply_filters( 'wpcf7_validate_' . $tag['type'],
74
  $posted_data = array_diff_key( $posted_data, array( '_wpnonce' => '' ) );
75
  $posted_data = $this->sanitize_posted_data( $posted_data );
76
 
77
+ $tags = $this->contact_form->scan_form_tags();
78
 
79
  foreach ( (array) $tags as $tag ) {
80
  if ( empty( $tag['name'] ) ) {
131
  }
132
 
133
  $this->meta = array(
134
+ 'remote_ip' => $this->get_remote_ip_addr(),
 
 
135
  'user_agent' => isset( $_SERVER['HTTP_USER_AGENT'] )
136
  ? substr( $_SERVER['HTTP_USER_AGENT'], 0, 254 ) : '',
137
  'url' => preg_replace( '%(?<!:|/)/.*$%', '',
172
  return $this->status;
173
  }
174
 
175
+ private function get_remote_ip_addr() {
176
+ if ( isset( $_SERVER['REMOTE_ADDR'] )
177
+ && WP_Http::is_ip_address( $_SERVER['REMOTE_ADDR'] ) ) {
178
+ return $_SERVER['REMOTE_ADDR'];
179
+ }
180
+
181
+ return '';
182
+ }
183
+
184
  private function validate() {
185
  if ( $this->invalid_fields ) {
186
  return false;
189
  require_once WPCF7_PLUGIN_DIR . '/includes/validation.php';
190
  $result = new WPCF7_Validation();
191
 
192
+ $tags = $this->contact_form->scan_form_tags();
193
 
194
  foreach ( $tags as $tag ) {
195
  $result = apply_filters( 'wpcf7_validate_' . $tag['type'],
includes/upgrade.php CHANGED
@@ -5,8 +5,9 @@ add_action( 'wpcf7_upgrade', 'wpcf7_convert_to_cpt', 10, 2 );
5
  function wpcf7_convert_to_cpt( $new_ver, $old_ver ) {
6
  global $wpdb;
7
 
8
- if ( ! version_compare( $old_ver, '3.0-dev', '<' ) )
9
  return;
 
10
 
11
  $old_rows = array();
12
 
@@ -24,8 +25,9 @@ function wpcf7_convert_to_cpt( $new_ver, $old_ver ) {
24
  $q = "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_old_cf7_unit_id'"
25
  . $wpdb->prepare( " AND meta_value = %d", $row->cf7_unit_id );
26
 
27
- if ( $wpdb->get_var( $q ) )
28
  continue;
 
29
 
30
  $postarr = array(
31
  'post_type' => 'wpcf7_contact_form',
@@ -50,11 +52,13 @@ function wpcf7_convert_to_cpt( $new_ver, $old_ver ) {
50
  add_action( 'wpcf7_upgrade', 'wpcf7_prepend_underscore', 10, 2 );
51
 
52
  function wpcf7_prepend_underscore( $new_ver, $old_ver ) {
53
- if ( version_compare( $old_ver, '3.0-dev', '<' ) )
54
  return;
 
55
 
56
- if ( ! version_compare( $old_ver, '3.3-dev', '<' ) )
57
  return;
 
58
 
59
  $posts = WPCF7_ContactForm::find( array(
60
  'post_status' => 'any',
@@ -64,13 +68,12 @@ function wpcf7_prepend_underscore( $new_ver, $old_ver ) {
64
  $props = $post->get_properties();
65
 
66
  foreach ( $props as $prop => $value ) {
67
- if ( metadata_exists( 'post', $post->id(), '_' . $prop ) )
68
  continue;
 
69
 
70
  update_post_meta( $post->id(), '_' . $prop, $value );
71
  delete_post_meta( $post->id(), $prop );
72
  }
73
  }
74
  }
75
-
76
- ?>
5
  function wpcf7_convert_to_cpt( $new_ver, $old_ver ) {
6
  global $wpdb;
7
 
8
+ if ( ! version_compare( $old_ver, '3.0-dev', '<' ) ) {
9
  return;
10
+ }
11
 
12
  $old_rows = array();
13
 
25
  $q = "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_old_cf7_unit_id'"
26
  . $wpdb->prepare( " AND meta_value = %d", $row->cf7_unit_id );
27
 
28
+ if ( $wpdb->get_var( $q ) ) {
29
  continue;
30
+ }
31
 
32
  $postarr = array(
33
  'post_type' => 'wpcf7_contact_form',
52
  add_action( 'wpcf7_upgrade', 'wpcf7_prepend_underscore', 10, 2 );
53
 
54
  function wpcf7_prepend_underscore( $new_ver, $old_ver ) {
55
+ if ( version_compare( $old_ver, '3.0-dev', '<' ) ) {
56
  return;
57
+ }
58
 
59
+ if ( ! version_compare( $old_ver, '3.3-dev', '<' ) ) {
60
  return;
61
+ }
62
 
63
  $posts = WPCF7_ContactForm::find( array(
64
  'post_status' => 'any',
68
  $props = $post->get_properties();
69
 
70
  foreach ( $props as $prop => $value ) {
71
+ if ( metadata_exists( 'post', $post->id(), '_' . $prop ) ) {
72
  continue;
73
+ }
74
 
75
  update_post_meta( $post->id(), '_' . $prop, $value );
76
  delete_post_meta( $post->id(), $prop );
77
  }
78
  }
79
  }
 
 
includes/validation.php CHANGED
@@ -12,13 +12,13 @@ class WPCF7_Validation implements ArrayAccess {
12
  }
13
 
14
  public function invalidate( $context, $message ) {
15
- if ( $context instanceof WPCF7_Shortcode ) {
16
  $tag = $context;
17
  } elseif ( is_array( $context ) ) {
18
- $tag = new WPCF7_Shortcode( $context );
19
  } elseif ( is_string( $context ) ) {
20
- $tags = wpcf7_scan_shortcode( array( 'name' => trim( $context ) ) );
21
- $tag = $tags ? new WPCF7_Shortcode( $tags[0] ) : null;
22
  }
23
 
24
  $name = ! empty( $tag ) ? $tag->name : null;
@@ -77,5 +77,3 @@ class WPCF7_Validation implements ArrayAccess {
77
  public function offsetUnset( $offset ) {
78
  }
79
  }
80
-
81
- ?>
12
  }
13
 
14
  public function invalidate( $context, $message ) {
15
+ if ( $context instanceof WPCF7_FormTag ) {
16
  $tag = $context;
17
  } elseif ( is_array( $context ) ) {
18
+ $tag = new WPCF7_FormTag( $context );
19
  } elseif ( is_string( $context ) ) {
20
+ $tags = wpcf7_scan_form_tags( array( 'name' => trim( $context ) ) );
21
+ $tag = $tags ? new WPCF7_FormTag( $tags[0] ) : null;
22
  }
23
 
24
  $name = ! empty( $tag ) ? $tag->name : null;
77
  public function offsetUnset( $offset ) {
78
  }
79
  }
 
 
languages/contact-form-7-af.mo DELETED
Binary file
languages/contact-form-7-ar.mo DELETED
Binary file
languages/contact-form-7-bel.mo DELETED
Binary file
languages/contact-form-7-bg_BG.mo DELETED
Binary file
languages/contact-form-7-bn_BD.mo DELETED
Binary file
languages/contact-form-7-bn_IN.mo DELETED
Binary file
languages/contact-form-7-bs_BA.mo DELETED
Binary file
languages/contact-form-7-ca.mo DELETED
Binary file
languages/contact-form-7-ckb.mo DELETED
Binary file
languages/contact-form-7-el.mo DELETED
Binary file
languages/contact-form-7-eo.mo DELETED
Binary file
languages/contact-form-7-eu.mo DELETED
Binary file
languages/contact-form-7-fa_IR.mo DELETED
Binary file
languages/contact-form-7-ga.mo DELETED
Binary file
languages/contact-form-7-gl_ES.mo DELETED
Binary file
languages/contact-form-7-gu.mo DELETED
Binary file
languages/contact-form-7-hi_IN.mo DELETED
Binary file
languages/contact-form-7-ht.mo DELETED
Binary file
languages/contact-form-7-hy.mo DELETED
Binary file
languages/contact-form-7-id_ID.mo DELETED
Binary file
languages/contact-form-7-ka_GE.mo DELETED
Binary file
languages/contact-form-7-ko_KR.mo DELETED
Binary file
languages/contact-form-7-lt_LT.mo DELETED
Binary file
languages/contact-form-7-lv.mo DELETED
Binary file
languages/contact-form-7-mk_MK.mo DELETED
Binary file
languages/contact-form-7-ml_IN.mo DELETED
Binary file
languages/contact-form-7-ms_MY.mo DELETED
Binary file
languages/contact-form-7-mt_MT.mo DELETED
Binary file
languages/contact-form-7-nb_NO.mo DELETED
Binary file
languages/contact-form-7-pa_IN.mo DELETED
Binary file
languages/contact-form-7-si_LK.mo DELETED
Binary file
languages/contact-form-7-sl_SI.mo DELETED
Binary file
languages/contact-form-7-sq.mo DELETED
Binary file
languages/contact-form-7-sr_RS.mo DELETED
Binary file
languages/contact-form-7-ta_IN.mo DELETED
Binary file
languages/contact-form-7-th.mo DELETED
Binary file
languages/contact-form-7-tl.mo DELETED
Binary file
languages/contact-form-7-uk.mo DELETED
Binary file
languages/contact-form-7-vi.mo DELETED
Binary file
languages/contact-form-7-zh_CN.mo DELETED
Binary file
languages/contact-form-7-zh_TW.mo DELETED
Binary file
languages/contact-form-7.pot DELETED
@@ -1,1459 +0,0 @@
1
- #, fuzzy
2
- msgid ""
3
- msgstr ""
4
- "Project-Id-Version: Contact Form 7\n"
5
- "Report-Msgid-Bugs-To: \n"
6
- "POT-Creation-Date: 2016-03-13 09:12+0900\n"
7
- "PO-Revision-Date: 2015-05-18 21:49+0900\n"
8
- "Last-Translator: Takayuki Miyoshi <takayukister@gmail.com>\n"
9
- "Language-Team: \n"
10
- "MIME-Version: 1.0\n"
11
- "Content-Type: text/plain; charset=UTF-8\n"
12
- "Content-Transfer-Encoding: 8bit\n"
13
- "X-Poedit-SourceCharset: UTF-8\n"
14
- "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_c;_n:1,2;_x\n"
15
- "X-Poedit-Basepath: ../..\n"
16
- "Plural-Forms: nplurals=1; plural=0;\n"
17
- "X-Generator: Poedit 1.8.6\n"
18
- "X-Poedit-SearchPath-0: contact-form-7\n"
19
-
20
- #: contact-form-7/wp-contact-form-7.php:5
21
- msgid "Just another contact form plugin. Simple but flexible."
22
- msgstr ""
23
-
24
- #: contact-form-7/admin/admin.php:20 contact-form-7/modules/flamingo.php:137
25
- msgid "Contact Form 7"
26
- msgstr ""
27
-
28
- #: contact-form-7/admin/admin.php:21
29
- msgid "Contact"
30
- msgstr ""
31
-
32
- #: contact-form-7/admin/admin.php:27
33
- #: contact-form-7/admin/edit-contact-form.php:38
34
- msgid "Edit Contact Form"
35
- msgstr ""
36
-
37
- #: contact-form-7/admin/admin.php:28 contact-form-7/admin/admin.php:283
38
- #: contact-form-7/includes/contact-form.php:30
39
- msgid "Contact Forms"
40
- msgstr ""
41
-
42
- #: contact-form-7/admin/admin.php:35
43
- #: contact-form-7/admin/edit-contact-form.php:36
44
- msgid "Add New Contact Form"
45
- msgstr ""
46
-
47
- #: contact-form-7/admin/admin.php:36 contact-form-7/admin/admin.php:286
48
- #: contact-form-7/admin/edit-contact-form.php:41
49
- msgid "Add New"
50
- msgstr ""
51
-
52
- #: contact-form-7/admin/admin.php:46 contact-form-7/admin/admin.php:368
53
- msgid "Integration with Other Services"
54
- msgstr ""
55
-
56
- #: contact-form-7/admin/admin.php:47
57
- msgid "Integration"
58
- msgstr ""
59
-
60
- #: contact-form-7/admin/admin.php:77 contact-form-7/admin/admin.php:99
61
- msgid "You are not allowed to edit this item."
62
- msgstr ""
63
-
64
- #: contact-form-7/admin/admin.php:138
65
- msgid "You are not allowed to delete this item."
66
- msgstr ""
67
-
68
- #: contact-form-7/admin/admin.php:141
69
- msgid "Error in deleting."
70
- msgstr ""
71
-
72
- #: contact-form-7/admin/admin.php:162
73
- msgid "You are not allowed to validate configuration."
74
- msgstr ""
75
-
76
- #: contact-form-7/admin/admin.php:250
77
- msgid "The changes you made will be lost if you navigate away from this page."
78
- msgstr ""
79
-
80
- #: contact-form-7/admin/admin.php:291
81
- #, php-format
82
- msgid "Search results for &#8220;%s&#8221;"
83
- msgstr ""
84
-
85
- #: contact-form-7/admin/admin.php:300
86
- msgid "Search Contact Forms"
87
- msgstr ""
88
-
89
- #: contact-form-7/admin/admin.php:314
90
- #, php-format
91
- msgid "Validate %s Contact Form Now"
92
- msgid_plural "Validate %s Contact Forms Now"
93
- msgstr[0] ""
94
-
95
- #: contact-form-7/admin/admin.php:322
96
- msgid "Validate Configuration"
97
- msgstr ""
98
-
99
- #: contact-form-7/admin/admin.php:330
100
- msgid "http://contactform7.com/configuration-validator-faq/"
101
- msgstr ""
102
-
103
- #: contact-form-7/admin/admin.php:330
104
- msgid "FAQ about Configuration Validator"
105
- msgstr ""
106
-
107
- #: contact-form-7/admin/admin.php:397
108
- msgid "Contact form created."
109
- msgstr ""
110
-
111
- #: contact-form-7/admin/admin.php:399
112
- msgid "Contact form saved."
113
- msgstr ""
114
-
115
- #: contact-form-7/admin/admin.php:401
116
- msgid "Contact form deleted."
117
- msgstr ""
118
-
119
- #: contact-form-7/admin/admin.php:417
120
- #, php-format
121
- msgid "Configuration validation completed. An invalid contact form was found."
122
- msgid_plural ""
123
- "Configuration validation completed. %s invalid contact forms were found."
124
- msgstr[0] ""
125
-
126
- #: contact-form-7/admin/admin.php:424
127
- msgid "Configuration validation completed. No invalid contact form was found."
128
- msgstr ""
129
-
130
- #: contact-form-7/admin/admin.php:440
131
- msgid "Settings"
132
- msgstr ""
133
-
134
- #: contact-form-7/admin/admin.php:458
135
- #, php-format
136
- msgid ""
137
- "<strong>Contact Form 7 %1$s requires WordPress %2$s or higher.</strong> "
138
- "Please <a href=\"%3$s\">update WordPress</a> first."
139
- msgstr ""
140
-
141
- #: contact-form-7/admin/admin.php:484
142
- msgid "Dismiss"
143
- msgstr ""
144
-
145
- #: contact-form-7/admin/admin.php:489
146
- msgid "Contact Form 7 Needs Your Support"
147
- msgstr ""
148
-
149
- #: contact-form-7/admin/admin.php:490
150
- msgid ""
151
- "It is hard to continue development and support for this plugin without "
152
- "contributions from users like you. If you enjoy using Contact Form 7 and "
153
- "find it useful, please consider making a donation."
154
- msgstr ""
155
-
156
- #: contact-form-7/admin/admin.php:491
157
- msgid "http://contactform7.com/donate/"
158
- msgstr ""
159
-
160
- #: contact-form-7/admin/admin.php:491
161
- msgid "Donate"
162
- msgstr ""
163
-
164
- #: contact-form-7/admin/admin.php:495
165
- msgid "Get Started"
166
- msgstr ""
167
-
168
- #: contact-form-7/admin/admin.php:497
169
- msgid "http://contactform7.com/getting-started-with-contact-form-7/"
170
- msgstr ""
171
-
172
- #: contact-form-7/admin/admin.php:497
173
- msgid "Getting Started with Contact Form 7"
174
- msgstr ""
175
-
176
- #: contact-form-7/admin/admin.php:498
177
- msgid "http://contactform7.com/admin-screen/"
178
- msgstr ""
179
-
180
- #: contact-form-7/admin/admin.php:498
181
- msgid "Admin Screen"
182
- msgstr ""
183
-
184
- #: contact-form-7/admin/admin.php:499
185
- msgid "http://contactform7.com/tag-syntax/"
186
- msgstr ""
187
-
188
- #: contact-form-7/admin/admin.php:499
189
- msgid "How Tags Work"
190
- msgstr ""
191
-
192
- #: contact-form-7/admin/admin.php:500
193
- msgid "http://contactform7.com/setting-up-mail/"
194
- msgstr ""
195
-
196
- #: contact-form-7/admin/admin.php:500
197
- msgid "Setting Up Mail"
198
- msgstr ""
199
-
200
- #: contact-form-7/admin/admin.php:505
201
- msgid "Did You Know?"
202
- msgstr ""
203
-
204
- #: contact-form-7/admin/admin.php:507
205
- msgid "http://contactform7.com/spam-filtering-with-akismet/"
206
- msgstr ""
207
-
208
- #: contact-form-7/admin/admin.php:507
209
- msgid "Spam Filtering with Akismet"
210
- msgstr ""
211
-
212
- #: contact-form-7/admin/admin.php:508
213
- msgid "http://contactform7.com/save-submitted-messages-with-flamingo/"
214
- msgstr ""
215
-
216
- #: contact-form-7/admin/admin.php:508
217
- msgid "Save Messages with Flamingo"
218
- msgstr ""
219
-
220
- #: contact-form-7/admin/admin.php:509
221
- msgid "http://contactform7.com/selectable-recipient-with-pipes/"
222
- msgstr ""
223
-
224
- #: contact-form-7/admin/admin.php:509
225
- msgid "Selectable Recipient with Pipes"
226
- msgstr ""
227
-
228
- #: contact-form-7/admin/admin.php:510
229
- msgid ""
230
- "http://contactform7.com/tracking-form-submissions-with-google-analytics/"
231
- msgstr ""
232
-
233
- #: contact-form-7/admin/admin.php:510
234
- msgid "Tracking with Google Analytics"
235
- msgstr ""
236
-
237
- #: contact-form-7/admin/admin.php:555
238
- msgid "You are not allowed to edit this contact form."
239
- msgstr ""
240
-
241
- #: contact-form-7/admin/admin.php:578
242
- #, php-format
243
- msgid "This contact form has a configuration error."
244
- msgid_plural "This contact form has %s configuration errors."
245
- msgstr[0] ""
246
-
247
- #: contact-form-7/admin/admin.php:584
248
- msgid "http://contactform7.com/configuration-errors/"
249
- msgstr ""
250
-
251
- #: contact-form-7/admin/admin.php:585
252
- msgid "How to Resolve Configuration Errors"
253
- msgstr ""
254
-
255
- #: contact-form-7/admin/admin.php:612
256
- msgid "Validate Contact Form 7 Configuration"
257
- msgstr ""
258
-
259
- #: contact-form-7/admin/admin.php:614
260
- msgid ""
261
- "Misconfiguration leads to mail delivery failure or other troubles. Validate "
262
- "your contact forms now."
263
- msgstr ""
264
-
265
- #: contact-form-7/admin/edit-contact-form.php:26
266
- #: contact-form-7/admin/edit-contact-form.php:124
267
- #: contact-form-7/modules/recaptcha.php:206
268
- msgid "Save"
269
- msgstr ""
270
-
271
- #: contact-form-7/admin/edit-contact-form.php:74
272
- msgid "Enter title here"
273
- msgstr ""
274
-
275
- #: contact-form-7/admin/edit-contact-form.php:96
276
- msgid ""
277
- "Copy this shortcode and paste it into your post, page, or text widget "
278
- "content:"
279
- msgstr ""
280
-
281
- #: contact-form-7/admin/edit-contact-form.php:103
282
- msgid "You can also use this old-style shortcode:"
283
- msgstr ""
284
-
285
- #: contact-form-7/admin/edit-contact-form.php:117
286
- msgid "Status"
287
- msgstr ""
288
-
289
- #: contact-form-7/admin/edit-contact-form.php:131
290
- #: contact-form-7/admin/includes/class-contact-forms-list-table.php:139
291
- msgid "Duplicate"
292
- msgstr ""
293
-
294
- #: contact-form-7/admin/edit-contact-form.php:142
295
- #: contact-form-7/admin/includes/class-contact-forms-list-table.php:83
296
- msgid "Delete"
297
- msgstr ""
298
-
299
- #: contact-form-7/admin/edit-contact-form.php:142
300
- msgid ""
301
- "You are about to delete this contact form.\n"
302
- " 'Cancel' to stop, 'OK' to delete."
303
- msgstr ""
304
-
305
- #: contact-form-7/admin/edit-contact-form.php:158
306
- msgid "Information"
307
- msgstr ""
308
-
309
- #: contact-form-7/admin/edit-contact-form.php:161
310
- #: contact-form-7/admin/includes/help-tabs.php:92
311
- msgid "http://contactform7.com/docs/"
312
- msgstr ""
313
-
314
- #: contact-form-7/admin/edit-contact-form.php:161
315
- #: contact-form-7/admin/includes/help-tabs.php:92
316
- msgid "Docs"
317
- msgstr ""
318
-
319
- #: contact-form-7/admin/edit-contact-form.php:162
320
- #: contact-form-7/admin/includes/help-tabs.php:93
321
- msgid "http://contactform7.com/faq/"
322
- msgstr ""
323
-
324
- #: contact-form-7/admin/edit-contact-form.php:162
325
- #: contact-form-7/admin/includes/help-tabs.php:93
326
- msgid "FAQ"
327
- msgstr ""
328
-
329
- #: contact-form-7/admin/edit-contact-form.php:163
330
- #: contact-form-7/admin/includes/help-tabs.php:94
331
- msgid "http://contactform7.com/support/"
332
- msgstr ""
333
-
334
- #: contact-form-7/admin/edit-contact-form.php:163
335
- #: contact-form-7/admin/includes/help-tabs.php:94
336
- msgid "Support"
337
- msgstr ""
338
-
339
- #: contact-form-7/admin/edit-contact-form.php:172
340
- #, php-format
341
- msgid "%s keys switch panels"
342
- msgstr ""
343
-
344
- #: contact-form-7/admin/edit-contact-form.php:182
345
- #: contact-form-7/admin/includes/editor.php:45
346
- msgid "Form"
347
- msgstr ""
348
-
349
- #: contact-form-7/admin/edit-contact-form.php:185
350
- #: contact-form-7/admin/includes/editor.php:72
351
- msgid "Mail"
352
- msgstr ""
353
-
354
- #: contact-form-7/admin/edit-contact-form.php:188
355
- #: contact-form-7/admin/includes/editor.php:202
356
- msgid "Messages"
357
- msgstr ""
358
-
359
- #: contact-form-7/admin/edit-contact-form.php:199
360
- #, php-format
361
- msgid "Additional Settings (%d)"
362
- msgstr ""
363
-
364
- #: contact-form-7/admin/edit-contact-form.php:201
365
- #: contact-form-7/admin/includes/editor.php:234
366
- #: contact-form-7/admin/includes/editor.php:239
367
- msgid "Additional Settings"
368
- msgstr ""
369
-
370
- #: contact-form-7/admin/includes/class-contact-forms-list-table.php:11
371
- msgid "Title"
372
- msgstr ""
373
-
374
- #: contact-form-7/admin/includes/class-contact-forms-list-table.php:12
375
- msgid "Shortcode"
376
- msgstr ""
377
-
378
- #: contact-form-7/admin/includes/class-contact-forms-list-table.php:13
379
- msgid "Author"
380
- msgstr ""
381
-
382
- #: contact-form-7/admin/includes/class-contact-forms-list-table.php:14
383
- msgid "Date"
384
- msgstr ""
385
-
386
- #: contact-form-7/admin/includes/class-contact-forms-list-table.php:106
387
- #, php-format
388
- msgid "Edit &#8220;%s&#8221;"
389
- msgstr ""
390
-
391
- #: contact-form-7/admin/includes/class-contact-forms-list-table.php:117
392
- #, php-format
393
- msgid "%s configuration error found"
394
- msgid_plural "%s configuration errors found"
395
- msgstr[0] ""
396
-
397
- #: contact-form-7/admin/includes/class-contact-forms-list-table.php:129
398
- msgid "Edit"
399
- msgstr ""
400
-
401
- #: contact-form-7/admin/includes/class-contact-forms-list-table.php:184
402
- msgid "Y/m/d g:i:s A"
403
- msgstr ""
404
-
405
- #: contact-form-7/admin/includes/class-contact-forms-list-table.php:191
406
- #, php-format
407
- msgid "%s ago"
408
- msgstr ""
409
-
410
- #: contact-form-7/admin/includes/class-contact-forms-list-table.php:193
411
- msgid "Y/m/d"
412
- msgstr ""
413
-
414
- #: contact-form-7/admin/includes/editor.php:64
415
- msgid "Mail (2)"
416
- msgstr ""
417
-
418
- #: contact-form-7/admin/includes/editor.php:65
419
- msgid "Use Mail (2)"
420
- msgstr ""
421
-
422
- #: contact-form-7/admin/includes/editor.php:92
423
- msgid "Mail (2) is an additional mail template often used as an autoresponder."
424
- msgstr ""
425
-
426
- #: contact-form-7/admin/includes/editor.php:98
427
- msgid "In the following fields, you can use these mail-tags:"
428
- msgstr ""
429
-
430
- #: contact-form-7/admin/includes/editor.php:104
431
- msgid "To"
432
- msgstr ""
433
-
434
- #: contact-form-7/admin/includes/editor.php:118
435
- msgid "From"
436
- msgstr ""
437
-
438
- #: contact-form-7/admin/includes/editor.php:132
439
- #: contact-form-7/includes/contact-form-template.php:29
440
- msgid "Subject"
441
- msgstr ""
442
-
443
- #: contact-form-7/admin/includes/editor.php:146
444
- msgid "Additional Headers"
445
- msgstr ""
446
-
447
- #: contact-form-7/admin/includes/editor.php:160
448
- msgid "Message Body"
449
- msgstr ""
450
-
451
- #: contact-form-7/admin/includes/editor.php:170
452
- msgid "Exclude lines with blank mail-tags from output"
453
- msgstr ""
454
-
455
- #: contact-form-7/admin/includes/editor.php:172
456
- msgid "Use HTML content type"
457
- msgstr ""
458
-
459
- #: contact-form-7/admin/includes/editor.php:178
460
- msgid "File Attachments"
461
- msgstr ""
462
-
463
- #: contact-form-7/admin/includes/editor.php:204
464
- msgid "Edit messages used in the following situations."
465
- msgstr ""
466
-
467
- #: contact-form-7/admin/includes/editor.php:233
468
- msgid "http://contactform7.com/additional-settings/"
469
- msgstr ""
470
-
471
- #: contact-form-7/admin/includes/editor.php:235
472
- #, php-format
473
- msgid "You can add customization code snippets here. For details, see %s."
474
- msgstr ""
475
-
476
- #: contact-form-7/admin/includes/help-tabs.php:16
477
- #: contact-form-7/admin/includes/help-tabs.php:30
478
- #: contact-form-7/admin/includes/help-tabs.php:49
479
- msgid "Overview"
480
- msgstr ""
481
-
482
- #: contact-form-7/admin/includes/help-tabs.php:21
483
- msgid "Available Actions"
484
- msgstr ""
485
-
486
- #: contact-form-7/admin/includes/help-tabs.php:35
487
- msgid "Form-tags"
488
- msgstr ""
489
-
490
- #: contact-form-7/admin/includes/help-tabs.php:40
491
- msgid "Mail-tags"
492
- msgstr ""
493
-
494
- #: contact-form-7/admin/includes/help-tabs.php:61
495
- msgid ""
496
- "On this screen, you can manage contact forms provided by Contact Form 7. You "
497
- "can manage an unlimited number of contact forms. Each contact form has a "
498
- "unique ID and Contact Form 7 shortcode ([contact-form-7 ...]). To insert a "
499
- "contact form into a post or a text widget, insert the shortcode into the "
500
- "target."
501
- msgstr ""
502
-
503
- #: contact-form-7/admin/includes/help-tabs.php:63
504
- msgid ""
505
- "Hovering over a row in the contact forms list will display action links that "
506
- "allow you to manage your contact form. You can perform the following actions:"
507
- msgstr ""
508
-
509
- #: contact-form-7/admin/includes/help-tabs.php:64
510
- msgid ""
511
- "<strong>Edit</strong> - Navigates to the editing screen for that contact "
512
- "form. You can also reach that screen by clicking on the contact form title."
513
- msgstr ""
514
-
515
- #: contact-form-7/admin/includes/help-tabs.php:65
516
- msgid ""
517
- "<strong>Duplicate</strong> - Clones that contact form. A cloned contact form "
518
- "inherits all content from the original, but has a different ID."
519
- msgstr ""
520
-
521
- #: contact-form-7/admin/includes/help-tabs.php:67
522
- msgid ""
523
- "On this screen, you can edit a contact form. A contact form is comprised of "
524
- "the following components:"
525
- msgstr ""
526
-
527
- #: contact-form-7/admin/includes/help-tabs.php:68
528
- msgid ""
529
- "<strong>Title</strong> is the title of a contact form. This title is only "
530
- "used for labeling a contact form, and can be edited."
531
- msgstr ""
532
-
533
- #: contact-form-7/admin/includes/help-tabs.php:69
534
- msgid ""
535
- "<strong>Form</strong> is a content of HTML form. You can use arbitrary HTML, "
536
- "which is allowed inside a form element. You can also use Contact Form "
537
- "7&#8217;s form-tags here."
538
- msgstr ""
539
-
540
- #: contact-form-7/admin/includes/help-tabs.php:70
541
- msgid ""
542
- "<strong>Mail</strong> manages a mail template (headers and message body) "
543
- "that this contact form will send when users submit it. You can use Contact "
544
- "Form 7&#8217;s mail-tags here."
545
- msgstr ""
546
-
547
- #: contact-form-7/admin/includes/help-tabs.php:71
548
- msgid ""
549
- "<strong>Mail (2)</strong> is an additional mail template that works similar "
550
- "to Mail. Mail (2) is different in that it is sent only when Mail has been "
551
- "sent successfully."
552
- msgstr ""
553
-
554
- #: contact-form-7/admin/includes/help-tabs.php:72
555
- msgid ""
556
- "In <strong>Messages</strong>, you can edit various types of messages used "
557
- "for this contact form. These messages are relatively short messages, like a "
558
- "validation error message you see when you leave a required field blank."
559
- msgstr ""
560
-
561
- #: contact-form-7/admin/includes/help-tabs.php:73
562
- msgid ""
563
- "<strong>Additional Settings</strong> provides a place where you can "
564
- "customize the behavior of this contact form by adding code snippets."
565
- msgstr ""
566
-
567
- #: contact-form-7/admin/includes/help-tabs.php:75
568
- msgid ""
569
- "A form-tag is a short code enclosed in square brackets used in a form "
570
- "content. A form-tag generally represents an input field, and its components "
571
- "can be separated into four parts: type, name, options, and values. Contact "
572
- "Form 7 supports several types of form-tags including text fields, number "
573
- "fields, date fields, checkboxes, radio buttons, menus, file-uploading "
574
- "fields, CAPTCHAs, and quiz fields."
575
- msgstr ""
576
-
577
- #: contact-form-7/admin/includes/help-tabs.php:76
578
- msgid ""
579
- "While form-tags have a comparatively complex syntax, you don&#8217;t need to "
580
- "know the syntax to add form-tags because you can use the straightforward tag "
581
- "generator (<strong>Generate Tag</strong> button on this screen)."
582
- msgstr ""
583
-
584
- #: contact-form-7/admin/includes/help-tabs.php:78
585
- msgid ""
586
- "A mail-tag is also a short code enclosed in square brackets that you can use "
587
- "in every Mail and Mail (2) field. A mail-tag represents a user input value "
588
- "through an input field of a corresponding form-tag."
589
- msgstr ""
590
-
591
- #: contact-form-7/admin/includes/help-tabs.php:79
592
- msgid ""
593
- "There are also special mail-tags that have specific names, but don&#8217;t "
594
- "have corresponding form-tags. They are used to represent meta information of "
595
- "form submissions like the submitter&#8217;s IP address or the URL of the "
596
- "page."
597
- msgstr ""
598
-
599
- #: contact-form-7/admin/includes/help-tabs.php:81
600
- msgid ""
601
- "On this screen, you can manage services that are available through Contact "
602
- "Form 7. Using API will allow you to collaborate with any services that are "
603
- "available."
604
- msgstr ""
605
-
606
- #: contact-form-7/admin/includes/help-tabs.php:82
607
- msgid ""
608
- "You may need to first sign up for an account with the service that you plan "
609
- "to use. When you do so, you would need to authorize Contact Form 7 to access "
610
- "the service with your account."
611
- msgstr ""
612
-
613
- #: contact-form-7/admin/includes/help-tabs.php:83
614
- msgid ""
615
- "Any information you provide will not be shared with service providers "
616
- "without your authorization."
617
- msgstr ""
618
-
619
- #: contact-form-7/admin/includes/help-tabs.php:91
620
- msgid "For more information:"
621
- msgstr ""
622
-
623
- #: contact-form-7/admin/includes/tag-generator.php:43
624
- #, php-format
625
- msgid "Form-tag Generator: %s"
626
- msgstr ""
627
-
628
- #: contact-form-7/includes/config-validator.php:41
629
- msgid "This field can be empty depending on user input."
630
- msgstr ""
631
-
632
- #: contact-form-7/includes/config-validator.php:43
633
- msgid "This field has syntax errors."
634
- msgstr ""
635
-
636
- #: contact-form-7/includes/config-validator.php:45
637
- msgid "This email address does not belong to the same domain as the site."
638
- msgstr ""
639
-
640
- #: contact-form-7/includes/config-validator.php:47
641
- msgid "HTML tags are not allowed in a message."
642
- msgstr ""
643
-
644
- #: contact-form-7/includes/contact-form-template.php:23
645
- msgid "Your Name"
646
- msgstr ""
647
-
648
- #: contact-form-7/includes/contact-form-template.php:24
649
- #: contact-form-7/includes/contact-form-template.php:27
650
- msgid "(required)"
651
- msgstr ""
652
-
653
- #: contact-form-7/includes/contact-form-template.php:26
654
- msgid "Your Email"
655
- msgstr ""
656
-
657
- #: contact-form-7/includes/contact-form-template.php:31
658
- msgid "Your Message"
659
- msgstr ""
660
-
661
- #: contact-form-7/includes/contact-form-template.php:33
662
- #: contact-form-7/modules/submit.php:28
663
- msgid "Send"
664
- msgstr ""
665
-
666
- #: contact-form-7/includes/contact-form-template.php:41
667
- #: contact-form-7/includes/contact-form-template.php:67
668
- #, php-format
669
- msgid "%1$s \"%2$s\""
670
- msgstr ""
671
-
672
- #: contact-form-7/includes/contact-form-template.php:45
673
- #, php-format
674
- msgid "From: %s"
675
- msgstr ""
676
-
677
- #: contact-form-7/includes/contact-form-template.php:47
678
- #, php-format
679
- msgid "Subject: %s"
680
- msgstr ""
681
-
682
- #: contact-form-7/includes/contact-form-template.php:49
683
- #: contact-form-7/includes/contact-form-template.php:72
684
- msgid "Message Body:"
685
- msgstr ""
686
-
687
- #: contact-form-7/includes/contact-form-template.php:52
688
- #: contact-form-7/includes/contact-form-template.php:75
689
- #, php-format
690
- msgid "This e-mail was sent from a contact form on %1$s (%2$s)"
691
- msgstr ""
692
-
693
- #: contact-form-7/includes/contact-form-template.php:121
694
- msgid "Sender's message was sent successfully"
695
- msgstr ""
696
-
697
- #: contact-form-7/includes/contact-form-template.php:123
698
- msgid "Thank you for your message. It has been sent."
699
- msgstr ""
700
-
701
- #: contact-form-7/includes/contact-form-template.php:128
702
- msgid "Sender's message failed to send"
703
- msgstr ""
704
-
705
- #: contact-form-7/includes/contact-form-template.php:130
706
- #: contact-form-7/includes/contact-form-template.php:144
707
- msgid "There was an error trying to send your message. Please try again later."
708
- msgstr ""
709
-
710
- #: contact-form-7/includes/contact-form-template.php:135
711
- msgid "Validation errors occurred"
712
- msgstr ""
713
-
714
- #: contact-form-7/includes/contact-form-template.php:137
715
- msgid "One or more fields have an error. Please check and try again."
716
- msgstr ""
717
-
718
- #: contact-form-7/includes/contact-form-template.php:142
719
- msgid "Submission was referred to as spam"
720
- msgstr ""
721
-
722
- #: contact-form-7/includes/contact-form-template.php:149
723
- msgid "There are terms that the sender must accept"
724
- msgstr ""
725
-
726
- #: contact-form-7/includes/contact-form-template.php:151
727
- msgid "You must accept the terms and conditions before sending your message."
728
- msgstr ""
729
-
730
- #: contact-form-7/includes/contact-form-template.php:156
731
- msgid "There is a field that the sender must fill in"
732
- msgstr ""
733
-
734
- #: contact-form-7/includes/contact-form-template.php:158
735
- msgid "The field is required."
736
- msgstr ""
737
-
738
- #: contact-form-7/includes/contact-form-template.php:163
739
- msgid ""
740
- "There is a field with input that is longer than the maximum allowed length"
741
- msgstr ""
742
-
743
- #: contact-form-7/includes/contact-form-template.php:165
744
- msgid "The field is too long."
745
- msgstr ""
746
-
747
- #: contact-form-7/includes/contact-form-template.php:170
748
- msgid ""
749
- "There is a field with input that is shorter than the minimum allowed length"
750
- msgstr ""
751
-
752
- #: contact-form-7/includes/contact-form-template.php:172
753
- msgid "The field is too short."
754
- msgstr ""
755
-
756
- #: contact-form-7/includes/contact-form.php:31
757
- msgid "Contact Form"
758
- msgstr ""
759
-
760
- #: contact-form-7/includes/contact-form.php:77
761
- #: contact-form-7/includes/contact-form.php:227
762
- msgid "Untitled"
763
- msgstr ""
764
-
765
- #: contact-form-7/includes/contact-form.php:153
766
- #, php-format
767
- msgid ""
768
- "<code>%1$s</code> property of a <code>WPCF7_ContactForm</code> object is "
769
- "<strong>no longer accessible</strong>. Use <code>%2$s</code> method instead."
770
- msgstr ""
771
-
772
- #: contact-form-7/includes/controller.php:170
773
- msgid "Please verify that you are not a robot."
774
- msgstr ""
775
-
776
- #: contact-form-7/includes/controller.php:171
777
- msgid "Sending ..."
778
- msgstr ""
779
-
780
- #: contact-form-7/modules/acceptance.php:130
781
- msgid "acceptance"
782
- msgstr ""
783
-
784
- #: contact-form-7/modules/acceptance.php:138
785
- #, php-format
786
- msgid ""
787
- "Generate a form-tag for an acceptance checkbox. For more details, see %s."
788
- msgstr ""
789
-
790
- #: contact-form-7/modules/acceptance.php:140
791
- msgid "http://contactform7.com/acceptance-checkbox/"
792
- msgstr ""
793
-
794
- #: contact-form-7/modules/acceptance.php:140
795
- msgid "Acceptance Checkbox"
796
- msgstr ""
797
-
798
- #: contact-form-7/modules/acceptance.php:150
799
- #: contact-form-7/modules/checkbox.php:309 contact-form-7/modules/date.php:169
800
- #: contact-form-7/modules/file.php:253 contact-form-7/modules/number.php:177
801
- #: contact-form-7/modules/quiz.php:181
802
- #: contact-form-7/modules/really-simple-captcha.php:233
803
- #: contact-form-7/modules/select.php:188 contact-form-7/modules/text.php:239
804
- #: contact-form-7/modules/textarea.php:155
805
- msgid "Name"
806
- msgstr ""
807
-
808
- #: contact-form-7/modules/acceptance.php:155
809
- #: contact-form-7/modules/acceptance.php:158
810
- #: contact-form-7/modules/checkbox.php:314
811
- #: contact-form-7/modules/checkbox.php:317
812
- #: contact-form-7/modules/select.php:193 contact-form-7/modules/select.php:196
813
- msgid "Options"
814
- msgstr ""
815
-
816
- #: contact-form-7/modules/acceptance.php:159
817
- msgid "Make this checkbox checked by default"
818
- msgstr ""
819
-
820
- #: contact-form-7/modules/acceptance.php:160
821
- msgid "Make this work inversely"
822
- msgstr ""
823
-
824
- #: contact-form-7/modules/acceptance.php:166
825
- #: contact-form-7/modules/checkbox.php:330 contact-form-7/modules/date.php:198
826
- #: contact-form-7/modules/file.php:268 contact-form-7/modules/number.php:206
827
- #: contact-form-7/modules/quiz.php:197
828
- #: contact-form-7/modules/really-simple-captcha.php:243
829
- #: contact-form-7/modules/really-simple-captcha.php:258
830
- #: contact-form-7/modules/recaptcha.php:445
831
- #: contact-form-7/modules/select.php:206 contact-form-7/modules/submit.php:71
832
- #: contact-form-7/modules/text.php:279 contact-form-7/modules/textarea.php:166
833
- msgid "Id attribute"
834
- msgstr ""
835
-
836
- #: contact-form-7/modules/acceptance.php:171
837
- #: contact-form-7/modules/checkbox.php:335 contact-form-7/modules/date.php:203
838
- #: contact-form-7/modules/file.php:273 contact-form-7/modules/number.php:211
839
- #: contact-form-7/modules/quiz.php:202
840
- #: contact-form-7/modules/really-simple-captcha.php:248
841
- #: contact-form-7/modules/really-simple-captcha.php:263
842
- #: contact-form-7/modules/recaptcha.php:450
843
- #: contact-form-7/modules/select.php:211 contact-form-7/modules/submit.php:76
844
- #: contact-form-7/modules/text.php:284 contact-form-7/modules/textarea.php:171
845
- msgid "Class attribute"
846
- msgstr ""
847
-
848
- #: contact-form-7/modules/acceptance.php:184
849
- #: contact-form-7/modules/checkbox.php:348 contact-form-7/modules/date.php:215
850
- #: contact-form-7/modules/file.php:286 contact-form-7/modules/number.php:223
851
- #: contact-form-7/modules/quiz.php:215
852
- #: contact-form-7/modules/really-simple-captcha.php:275
853
- #: contact-form-7/modules/recaptcha.php:463
854
- #: contact-form-7/modules/select.php:224 contact-form-7/modules/submit.php:89
855
- #: contact-form-7/modules/text.php:297 contact-form-7/modules/textarea.php:184
856
- msgid "Insert Tag"
857
- msgstr ""
858
-
859
- #: contact-form-7/modules/checkbox.php:267
860
- msgid "checkboxes"
861
- msgstr ""
862
-
863
- #: contact-form-7/modules/checkbox.php:269
864
- msgid "radio buttons"
865
- msgstr ""
866
-
867
- #: contact-form-7/modules/checkbox.php:282
868
- #, php-format
869
- msgid ""
870
- "Generate a form-tag for a group of checkboxes. For more details, see %s."
871
- msgstr ""
872
-
873
- #: contact-form-7/modules/checkbox.php:284
874
- #, php-format
875
- msgid ""
876
- "Generate a form-tag for a group of radio buttons. For more details, see %s."
877
- msgstr ""
878
-
879
- #: contact-form-7/modules/checkbox.php:287
880
- #: contact-form-7/modules/select.php:168
881
- msgid "http://contactform7.com/checkboxes-radio-buttons-and-menus/"
882
- msgstr ""
883
-
884
- #: contact-form-7/modules/checkbox.php:287
885
- #: contact-form-7/modules/select.php:168
886
- msgid "Checkboxes, Radio Buttons and Menus"
887
- msgstr ""
888
-
889
- #: contact-form-7/modules/checkbox.php:298
890
- #: contact-form-7/modules/checkbox.php:301 contact-form-7/modules/date.php:159
891
- #: contact-form-7/modules/date.php:162 contact-form-7/modules/file.php:243
892
- #: contact-form-7/modules/file.php:246 contact-form-7/modules/number.php:162
893
- #: contact-form-7/modules/number.php:165 contact-form-7/modules/select.php:178
894
- #: contact-form-7/modules/select.php:181 contact-form-7/modules/text.php:229
895
- #: contact-form-7/modules/text.php:232 contact-form-7/modules/textarea.php:145
896
- #: contact-form-7/modules/textarea.php:148
897
- msgid "Field type"
898
- msgstr ""
899
-
900
- #: contact-form-7/modules/checkbox.php:302 contact-form-7/modules/date.php:163
901
- #: contact-form-7/modules/file.php:247 contact-form-7/modules/number.php:171
902
- #: contact-form-7/modules/select.php:182 contact-form-7/modules/text.php:233
903
- #: contact-form-7/modules/textarea.php:149
904
- msgid "Required field"
905
- msgstr ""
906
-
907
- #: contact-form-7/modules/checkbox.php:319
908
- #: contact-form-7/modules/select.php:198
909
- msgid "One option per line."
910
- msgstr ""
911
-
912
- #: contact-form-7/modules/checkbox.php:320
913
- msgid "Put a label first, a checkbox last"
914
- msgstr ""
915
-
916
- #: contact-form-7/modules/checkbox.php:321
917
- msgid "Wrap each item with label element"
918
- msgstr ""
919
-
920
- #: contact-form-7/modules/checkbox.php:323
921
- msgid "Make checkboxes exclusive"
922
- msgstr ""
923
-
924
- #: contact-form-7/modules/checkbox.php:353 contact-form-7/modules/date.php:220
925
- #: contact-form-7/modules/number.php:228 contact-form-7/modules/select.php:229
926
- #: contact-form-7/modules/text.php:302 contact-form-7/modules/textarea.php:189
927
- #, php-format
928
- msgid ""
929
- "To use the value input through this field in a mail field, you need to "
930
- "insert the corresponding mail-tag (%s) into the field on the Mail tab."
931
- msgstr ""
932
-
933
- #: contact-form-7/modules/date.php:117
934
- msgid "Date format that the sender entered is invalid"
935
- msgstr ""
936
-
937
- #: contact-form-7/modules/date.php:118
938
- msgid "The date format is incorrect."
939
- msgstr ""
940
-
941
- #: contact-form-7/modules/date.php:122
942
- msgid "Date is earlier than minimum limit"
943
- msgstr ""
944
-
945
- #: contact-form-7/modules/date.php:123
946
- msgid "The date is before the earliest one allowed."
947
- msgstr ""
948
-
949
- #: contact-form-7/modules/date.php:127
950
- msgid "Date is later than maximum limit"
951
- msgstr ""
952
-
953
- #: contact-form-7/modules/date.php:128
954
- msgid "The date is after the latest one allowed."
955
- msgstr ""
956
-
957
- #: contact-form-7/modules/date.php:139
958
- msgid "date"
959
- msgstr ""
960
-
961
- #: contact-form-7/modules/date.php:147
962
- #, php-format
963
- msgid "Generate a form-tag for a date input field. For more details, see %s."
964
- msgstr ""
965
-
966
- #: contact-form-7/modules/date.php:149
967
- msgid "http://contactform7.com/date-field/"
968
- msgstr ""
969
-
970
- #: contact-form-7/modules/date.php:149
971
- msgid "Date Field"
972
- msgstr ""
973
-
974
- #: contact-form-7/modules/date.php:174 contact-form-7/modules/number.php:182
975
- #: contact-form-7/modules/text.php:244 contact-form-7/modules/textarea.php:160
976
- msgid "Default value"
977
- msgstr ""
978
-
979
- #: contact-form-7/modules/date.php:176 contact-form-7/modules/number.php:184
980
- #: contact-form-7/modules/text.php:246 contact-form-7/modules/textarea.php:162
981
- msgid "Use this text as the placeholder of the field"
982
- msgstr ""
983
-
984
- #: contact-form-7/modules/date.php:180 contact-form-7/modules/date.php:183
985
- #: contact-form-7/modules/number.php:188 contact-form-7/modules/number.php:191
986
- msgid "Range"
987
- msgstr ""
988
-
989
- #: contact-form-7/modules/date.php:185 contact-form-7/modules/number.php:193
990
- msgid "Min"
991
- msgstr ""
992
-
993
- #: contact-form-7/modules/date.php:190 contact-form-7/modules/number.php:198
994
- msgid "Max"
995
- msgstr ""
996
-
997
- #: contact-form-7/modules/file.php:195
998
- msgid "Uploading a file fails for any reason"
999
- msgstr ""
1000
-
1001
- #: contact-form-7/modules/file.php:196
1002
- msgid "There was an unknown error uploading the file."
1003
- msgstr ""
1004
-
1005
- #: contact-form-7/modules/file.php:200
1006
- msgid "Uploaded file is not allowed for file type"
1007
- msgstr ""
1008
-
1009
- #: contact-form-7/modules/file.php:201
1010
- msgid "You are not allowed to upload files of this type."
1011
- msgstr ""
1012
-
1013
- #: contact-form-7/modules/file.php:205
1014
- msgid "Uploaded file is too large"
1015
- msgstr ""
1016
-
1017
- #: contact-form-7/modules/file.php:206
1018
- msgid "The file is too big."
1019
- msgstr ""
1020
-
1021
- #: contact-form-7/modules/file.php:210
1022
- msgid "Uploading a file fails for PHP error"
1023
- msgstr ""
1024
-
1025
- #: contact-form-7/modules/file.php:211
1026
- msgid "There was an error uploading the file."
1027
- msgstr ""
1028
-
1029
- #: contact-form-7/modules/file.php:223
1030
- msgid "file"
1031
- msgstr ""
1032
-
1033
- #: contact-form-7/modules/file.php:231
1034
- #, php-format
1035
- msgid ""
1036
- "Generate a form-tag for a file uploading field. For more details, see %s."
1037
- msgstr ""
1038
-
1039
- #: contact-form-7/modules/file.php:233
1040
- msgid "http://contactform7.com/file-uploading-and-attachment/"
1041
- msgstr ""
1042
-
1043
- #: contact-form-7/modules/file.php:233
1044
- msgid "File Uploading and Attachment"
1045
- msgstr ""
1046
-
1047
- #: contact-form-7/modules/file.php:258
1048
- msgid "File size limit (bytes)"
1049
- msgstr ""
1050
-
1051
- #: contact-form-7/modules/file.php:263
1052
- msgid "Acceptable file types"
1053
- msgstr ""
1054
-
1055
- #: contact-form-7/modules/file.php:291
1056
- #, php-format
1057
- msgid ""
1058
- "To attach the file uploaded through this field to mail, you need to insert "
1059
- "the corresponding mail-tag (%s) into the File Attachments field on the Mail "
1060
- "tab."
1061
- msgstr ""
1062
-
1063
- #: contact-form-7/modules/file.php:317
1064
- #, php-format
1065
- msgid ""
1066
- "This contact form contains file uploading fields, but the temporary folder "
1067
- "for the files (%s) does not exist or is not writable. You can create the "
1068
- "folder or change its permission manually."
1069
- msgstr ""
1070
-
1071
- #: contact-form-7/modules/number.php:120
1072
- msgid "Number format that the sender entered is invalid"
1073
- msgstr ""
1074
-
1075
- #: contact-form-7/modules/number.php:121
1076
- msgid "The number format is invalid."
1077
- msgstr ""
1078
-
1079
- #: contact-form-7/modules/number.php:125
1080
- msgid "Number is smaller than minimum limit"
1081
- msgstr ""
1082
-
1083
- #: contact-form-7/modules/number.php:126
1084
- msgid "The number is smaller than the minimum allowed."
1085
- msgstr ""
1086
-
1087
- #: contact-form-7/modules/number.php:130
1088
- msgid "Number is larger than maximum limit"
1089
- msgstr ""
1090
-
1091
- #: contact-form-7/modules/number.php:131
1092
- msgid "The number is larger than the maximum allowed."
1093
- msgstr ""
1094
-
1095
- #: contact-form-7/modules/number.php:142
1096
- msgid "number"
1097
- msgstr ""
1098
-
1099
- #: contact-form-7/modules/number.php:150
1100
- #, php-format
1101
- msgid ""
1102
- "Generate a form-tag for a field for numeric value input. For more details, "
1103
- "see %s."
1104
- msgstr ""
1105
-
1106
- #: contact-form-7/modules/number.php:152
1107
- msgid "http://contactform7.com/number-fields/"
1108
- msgstr ""
1109
-
1110
- #: contact-form-7/modules/number.php:152
1111
- msgid "Number Fields"
1112
- msgstr ""
1113
-
1114
- #: contact-form-7/modules/number.php:167
1115
- msgid "Spinbox"
1116
- msgstr ""
1117
-
1118
- #: contact-form-7/modules/number.php:168
1119
- msgid "Slider"
1120
- msgstr ""
1121
-
1122
- #: contact-form-7/modules/quiz.php:149
1123
- msgid "Sender doesn't enter the correct answer to the quiz"
1124
- msgstr ""
1125
-
1126
- #: contact-form-7/modules/quiz.php:150
1127
- msgid "The answer to the quiz is incorrect."
1128
- msgstr ""
1129
-
1130
- #: contact-form-7/modules/quiz.php:161
1131
- msgid "quiz"
1132
- msgstr ""
1133
-
1134
- #: contact-form-7/modules/quiz.php:169
1135
- #, php-format
1136
- msgid ""
1137
- "Generate a form-tag for a question-answer pair. For more details, see %s."
1138
- msgstr ""
1139
-
1140
- #: contact-form-7/modules/quiz.php:171
1141
- msgid "http://contactform7.com/quiz/"
1142
- msgstr ""
1143
-
1144
- #: contact-form-7/modules/quiz.php:171
1145
- msgid "Quiz"
1146
- msgstr ""
1147
-
1148
- #: contact-form-7/modules/quiz.php:186 contact-form-7/modules/quiz.php:189
1149
- msgid "Questions and answers"
1150
- msgstr ""
1151
-
1152
- #: contact-form-7/modules/quiz.php:191
1153
- msgid ""
1154
- "One pipe-separated question-answer pair (e.g. The capital of Brazil?|Rio) "
1155
- "per line."
1156
- msgstr ""
1157
-
1158
- #: contact-form-7/modules/really-simple-captcha.php:19
1159
- msgid ""
1160
- "To use CAPTCHA, you need <a href=\"http://wordpress.org/extend/plugins/"
1161
- "really-simple-captcha/\">Really Simple CAPTCHA</a> plugin installed."
1162
- msgstr ""
1163
-
1164
- #: contact-form-7/modules/really-simple-captcha.php:185
1165
- msgid "The code that sender entered does not match the CAPTCHA"
1166
- msgstr ""
1167
-
1168
- #: contact-form-7/modules/really-simple-captcha.php:186
1169
- msgid "Your entered code is incorrect."
1170
- msgstr ""
1171
-
1172
- #: contact-form-7/modules/really-simple-captcha.php:202
1173
- msgid "CAPTCHA (Really Simple CAPTCHA)"
1174
- msgstr ""
1175
-
1176
- #: contact-form-7/modules/really-simple-captcha.php:213
1177
- #, php-format
1178
- msgid "To use CAPTCHA, you first need to install and activate %s plugin."
1179
- msgstr ""
1180
-
1181
- #: contact-form-7/modules/really-simple-captcha.php:221
1182
- #, php-format
1183
- msgid ""
1184
- "Generate form-tags for a CAPTCHA image and corresponding response input "
1185
- "field. For more details, see %s."
1186
- msgstr ""
1187
-
1188
- #: contact-form-7/modules/really-simple-captcha.php:223
1189
- msgid "http://contactform7.com/captcha/"
1190
- msgstr ""
1191
-
1192
- #: contact-form-7/modules/really-simple-captcha.php:223
1193
- #: contact-form-7/modules/recaptcha.php:218
1194
- msgid "CAPTCHA"
1195
- msgstr ""
1196
-
1197
- #: contact-form-7/modules/really-simple-captcha.php:240
1198
- msgid "Image settings"
1199
- msgstr ""
1200
-
1201
- #: contact-form-7/modules/really-simple-captcha.php:255
1202
- msgid "Input field settings"
1203
- msgstr ""
1204
-
1205
- #: contact-form-7/modules/really-simple-captcha.php:306
1206
- #, php-format
1207
- msgid ""
1208
- "This contact form contains CAPTCHA fields, but the temporary folder for the "
1209
- "files (%s) does not exist or is not writable. You can create the folder or "
1210
- "change its permission manually."
1211
- msgstr ""
1212
-
1213
- #: contact-form-7/modules/really-simple-captcha.php:312
1214
- msgid ""
1215
- "This contact form contains CAPTCHA fields, but the necessary libraries (GD "
1216
- "and FreeType) are not available on your server."
1217
- msgstr ""
1218
-
1219
- #: contact-form-7/modules/recaptcha.php:23
1220
- #: contact-form-7/modules/recaptcha.php:184
1221
- #: contact-form-7/modules/recaptcha.php:388
1222
- #: contact-form-7/modules/recaptcha.php:401
1223
- #: contact-form-7/modules/recaptcha.php:411
1224
- msgid "reCAPTCHA"
1225
- msgstr ""
1226
-
1227
- #: contact-form-7/modules/recaptcha.php:138
1228
- msgid "ERROR"
1229
- msgstr ""
1230
-
1231
- #: contact-form-7/modules/recaptcha.php:139
1232
- msgid "Invalid key values."
1233
- msgstr ""
1234
-
1235
- #: contact-form-7/modules/recaptcha.php:144
1236
- msgid "Settings saved."
1237
- msgstr ""
1238
-
1239
- #: contact-form-7/modules/recaptcha.php:150
1240
- msgid ""
1241
- "reCAPTCHA is a free service to protect your website from spam and abuse."
1242
- msgstr ""
1243
-
1244
- #: contact-form-7/modules/recaptcha.php:165
1245
- #: contact-form-7/modules/recaptcha.php:196
1246
- msgid "Site Key"
1247
- msgstr ""
1248
-
1249
- #: contact-form-7/modules/recaptcha.php:169
1250
- #: contact-form-7/modules/recaptcha.php:200
1251
- msgid "Secret Key"
1252
- msgstr ""
1253
-
1254
- #: contact-form-7/modules/recaptcha.php:175
1255
- msgid "Reset Keys"
1256
- msgstr ""
1257
-
1258
- #: contact-form-7/modules/recaptcha.php:180
1259
- msgid "To use reCAPTCHA, you need to install an API key pair."
1260
- msgstr ""
1261
-
1262
- #: contact-form-7/modules/recaptcha.php:182
1263
- msgid "Configure Keys"
1264
- msgstr ""
1265
-
1266
- #: contact-form-7/modules/recaptcha.php:184
1267
- #, php-format
1268
- msgid "For more details, see %s."
1269
- msgstr ""
1270
-
1271
- #: contact-form-7/modules/recaptcha.php:184
1272
- #: contact-form-7/modules/recaptcha.php:401
1273
- #: contact-form-7/modules/recaptcha.php:411
1274
- msgid "http://contactform7.com/recaptcha/"
1275
- msgstr ""
1276
-
1277
- #: contact-form-7/modules/recaptcha.php:401
1278
- #, php-format
1279
- msgid ""
1280
- "To use reCAPTCHA, first you need to install an API key pair. For more "
1281
- "details, see %s."
1282
- msgstr ""
1283
-
1284
- #: contact-form-7/modules/recaptcha.php:409
1285
- #, php-format
1286
- msgid "Generate a form-tag for a reCAPTCHA widget. For more details, see %s."
1287
- msgstr ""
1288
-
1289
- #: contact-form-7/modules/recaptcha.php:421
1290
- #: contact-form-7/modules/recaptcha.php:424
1291
- msgid "Theme"
1292
- msgstr ""
1293
-
1294
- #: contact-form-7/modules/recaptcha.php:425
1295
- msgid "Light"
1296
- msgstr ""
1297
-
1298
- #: contact-form-7/modules/recaptcha.php:427
1299
- msgid "Dark"
1300
- msgstr ""
1301
-
1302
- #: contact-form-7/modules/recaptcha.php:433
1303
- #: contact-form-7/modules/recaptcha.php:436
1304
- msgid "Size"
1305
- msgstr ""
1306
-
1307
- #: contact-form-7/modules/recaptcha.php:437
1308
- msgid "Normal"
1309
- msgstr ""
1310
-
1311
- #: contact-form-7/modules/recaptcha.php:439
1312
- msgid "Compact"
1313
- msgstr ""
1314
-
1315
- #: contact-form-7/modules/select.php:159
1316
- msgid "drop-down menu"
1317
- msgstr ""
1318
-
1319
- #: contact-form-7/modules/select.php:166
1320
- #, php-format
1321
- msgid "Generate a form-tag for a drop-down menu. For more details, see %s."
1322
- msgstr ""
1323
-
1324
- #: contact-form-7/modules/select.php:199
1325
- msgid "Allow multiple selections"
1326
- msgstr ""
1327
-
1328
- #: contact-form-7/modules/select.php:200
1329
- msgid "Insert a blank item as the first option"
1330
- msgstr ""
1331
-
1332
- #: contact-form-7/modules/submit.php:47
1333
- msgid "submit"
1334
- msgstr ""
1335
-
1336
- #: contact-form-7/modules/submit.php:54
1337
- #, php-format
1338
- msgid "Generate a form-tag for a submit button. For more details, see %s."
1339
- msgstr ""
1340
-
1341
- #: contact-form-7/modules/submit.php:56
1342
- msgid "http://contactform7.com/submit-button/"
1343
- msgstr ""
1344
-
1345
- #: contact-form-7/modules/submit.php:56
1346
- msgid "Submit Button"
1347
- msgstr ""
1348
-
1349
- #: contact-form-7/modules/submit.php:66
1350
- msgid "Label"
1351
- msgstr ""
1352
-
1353
- #: contact-form-7/modules/text.php:169
1354
- msgid "Email address that the sender entered is invalid"
1355
- msgstr ""
1356
-
1357
- #: contact-form-7/modules/text.php:170
1358
- msgid "The e-mail address entered is invalid."
1359
- msgstr ""
1360
-
1361
- #: contact-form-7/modules/text.php:174
1362
- msgid "URL that the sender entered is invalid"
1363
- msgstr ""
1364
-
1365
- #: contact-form-7/modules/text.php:175
1366
- msgid "The URL is invalid."
1367
- msgstr ""
1368
-
1369
- #: contact-form-7/modules/text.php:179
1370
- msgid "Telephone number that the sender entered is invalid"
1371
- msgstr ""
1372
-
1373
- #: contact-form-7/modules/text.php:180
1374
- msgid "The telephone number is invalid."
1375
- msgstr ""
1376
-
1377
- #: contact-form-7/modules/text.php:191
1378
- msgid "text"
1379
- msgstr ""
1380
-
1381
- #: contact-form-7/modules/text.php:193
1382
- msgid "email"
1383
- msgstr ""
1384
-
1385
- #: contact-form-7/modules/text.php:195
1386
- msgid "URL"
1387
- msgstr ""
1388
-
1389
- #: contact-form-7/modules/text.php:197
1390
- msgid "tel"
1391
- msgstr ""
1392
-
1393
- #: contact-form-7/modules/text.php:210
1394
- #, php-format
1395
- msgid ""
1396
- "Generate a form-tag for a single-line plain text input field. For more "
1397
- "details, see %s."
1398
- msgstr ""
1399
-
1400
- #: contact-form-7/modules/text.php:212
1401
- #, php-format
1402
- msgid ""
1403
- "Generate a form-tag for a single-line email address input field. For more "
1404
- "details, see %s."
1405
- msgstr ""
1406
-
1407
- #: contact-form-7/modules/text.php:214
1408
- #, php-format
1409
- msgid ""
1410
- "Generate a form-tag for a single-line URL input field. For more details, see "
1411
- "%s."
1412
- msgstr ""
1413
-
1414
- #: contact-form-7/modules/text.php:216
1415
- #, php-format
1416
- msgid ""
1417
- "Generate a form-tag for a single-line telephone number input field. For more "
1418
- "details, see %s."
1419
- msgstr ""
1420
-
1421
- #: contact-form-7/modules/text.php:219 contact-form-7/modules/textarea.php:135
1422
- msgid "http://contactform7.com/text-fields/"
1423
- msgstr ""
1424
-
1425
- #: contact-form-7/modules/text.php:219 contact-form-7/modules/textarea.php:135
1426
- msgid "Text Fields"
1427
- msgstr ""
1428
-
1429
- #: contact-form-7/modules/text.php:251 contact-form-7/modules/text.php:254
1430
- msgid "Akismet"
1431
- msgstr ""
1432
-
1433
- #: contact-form-7/modules/text.php:259
1434
- msgid "This field requires author's name"
1435
- msgstr ""
1436
-
1437
- #: contact-form-7/modules/text.php:264
1438
- msgid "This field requires author's email address"
1439
- msgstr ""
1440
-
1441
- #: contact-form-7/modules/text.php:269
1442
- msgid "This field requires author's URL"
1443
- msgstr ""
1444
-
1445
- #: contact-form-7/modules/textarea.php:125
1446
- msgid "text area"
1447
- msgstr ""
1448
-
1449
- #: contact-form-7/modules/textarea.php:133
1450
- #, php-format
1451
- msgid ""
1452
- "Generate a form-tag for a multi-line text input field. For more details, see "
1453
- "%s."
1454
- msgstr ""
1455
-
1456
- #: contact-form-7/settings.php:134
1457
- #, php-format
1458
- msgid "Contact form %d"
1459
- msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
languages/readme.txt CHANGED
@@ -1,9 +1,4 @@
1
- == For Translators ==
 
2
 
3
- We are in the process of migrating translations to translate.wordpress.org.
4
-
5
- http://contactform7.com/2016/01/08/translations-migrate-to-translate-wordpress-org/
6
-
7
- The language files in this directory will no longer be updated and will be removed at some point in the future.
8
-
9
- Thank you for your past contribution, and see you at translate.wordpress.org :)
1
+ Translations have moved to
2
+ https://translate.wordpress.org/projects/wp-plugins/contact-form-7
3
 
4
+ Thank you for your contribution.
 
 
 
 
 
 
modules/acceptance.php CHANGED
@@ -3,30 +3,33 @@
3
  ** A base module for [acceptance]
4
  **/
5
 
6
- /* Shortcode handler */
7
 
8
- add_action( 'wpcf7_init', 'wpcf7_add_shortcode_acceptance' );
9
 
10
- function wpcf7_add_shortcode_acceptance() {
11
- wpcf7_add_shortcode( 'acceptance',
12
- 'wpcf7_acceptance_shortcode_handler', true );
13
  }
14
 
15
- function wpcf7_acceptance_shortcode_handler( $tag ) {
16
- $tag = new WPCF7_Shortcode( $tag );
17
 
18
- if ( empty( $tag->name ) )
19
  return '';
 
20
 
21
  $validation_error = wpcf7_get_validation_error( $tag->name );
22
 
23
  $class = wpcf7_form_controls_class( $tag->type );
24
 
25
- if ( $validation_error )
26
  $class .= ' wpcf7-not-valid';
 
27
 
28
- if ( $tag->has_option( 'invert' ) )
29
  $class .= ' wpcf7-invert';
 
30
 
31
  $atts = array();
32
 
@@ -34,8 +37,9 @@ function wpcf7_acceptance_shortcode_handler( $tag ) {
34
  $atts['id'] = $tag->get_id_option();
35
  $atts['tabindex'] = $tag->get_option( 'tabindex', 'int', true );
36
 
37
- if ( $tag->has_option( 'default:on' ) )
38
  $atts['checked'] = 'checked';
 
39
 
40
  $atts['aria-invalid'] = $validation_error ? 'true' : 'false';
41
 
@@ -58,10 +62,11 @@ function wpcf7_acceptance_shortcode_handler( $tag ) {
58
  add_filter( 'wpcf7_validate_acceptance', 'wpcf7_acceptance_validation_filter', 10, 2 );
59
 
60
  function wpcf7_acceptance_validation_filter( $result, $tag ) {
61
- if ( ! wpcf7_acceptance_as_validation() )
62
  return $result;
 
63
 
64
- $tag = new WPCF7_Shortcode( $tag );
65
 
66
  $name = $tag->name;
67
  $value = ( ! empty( $_POST[$name] ) ? 1 : 0 );
@@ -84,7 +89,7 @@ function wpcf7_acceptance_filter( $accepted ) {
84
  if ( ! $accepted )
85
  return $accepted;
86
 
87
- $fes = wpcf7_scan_shortcode( array( 'type' => 'acceptance' ) );
88
 
89
  foreach ( $fes as $fe ) {
90
  $name = $fe['name'];
3
  ** A base module for [acceptance]
4
  **/
5
 
6
+ /* form_tag handler */
7
 
8
+ add_action( 'wpcf7_init', 'wpcf7_add_form_tag_acceptance' );
9
 
10
+ function wpcf7_add_form_tag_acceptance() {
11
+ wpcf7_add_form_tag( 'acceptance',
12
+ 'wpcf7_acceptance_form_tag_handler', true );
13
  }
14
 
15
+ function wpcf7_acceptance_form_tag_handler( $tag ) {
16
+ $tag = new WPCF7_FormTag( $tag );
17
 
18
+ if ( empty( $tag->name ) ) {
19
  return '';
20
+ }
21
 
22
  $validation_error = wpcf7_get_validation_error( $tag->name );
23
 
24
  $class = wpcf7_form_controls_class( $tag->type );
25
 
26
+ if ( $validation_error ) {
27
  $class .= ' wpcf7-not-valid';
28
+ }
29
 
30
+ if ( $tag->has_option( 'invert' ) ) {
31
  $class .= ' wpcf7-invert';
32
+ }
33
 
34
  $atts = array();
35
 
37
  $atts['id'] = $tag->get_id_option();
38
  $atts['tabindex'] = $tag->get_option( 'tabindex', 'int', true );
39
 
40
+ if ( $tag->has_option( 'default:on' ) ) {
41
  $atts['checked'] = 'checked';
42
+ }
43
 
44
  $atts['aria-invalid'] = $validation_error ? 'true' : 'false';
45
 
62
  add_filter( 'wpcf7_validate_acceptance', 'wpcf7_acceptance_validation_filter', 10, 2 );
63
 
64
  function wpcf7_acceptance_validation_filter( $result, $tag ) {
65
+ if ( ! wpcf7_acceptance_as_validation() ) {
66
  return $result;
67
+ }
68
 
69
+ $tag = new WPCF7_FormTag( $tag );
70
 
71
  $name = $tag->name;
72
  $value = ( ! empty( $_POST[$name] ) ? 1 : 0 );
89
  if ( ! $accepted )
90
  return $accepted;
91
 
92
+ $fes = wpcf7_scan_form_tags( array( 'type' => 'acceptance' ) );
93
 
94
  foreach ( $fes as $fe ) {
95
  $name = $fe['name'];
modules/akismet.php CHANGED
@@ -86,9 +86,9 @@ function wpcf7_akismet_submitted_params() {
86
  continue;
87
  }
88
 
89
- if ( $tags = wpcf7_scan_shortcode( array( 'name' => $key ) ) ) {
90
  $tag = $tags[0];
91
- $tag = new WPCF7_Shortcode( $tag );
92
 
93
  $akismet = $tag->get_option( 'akismet',
94
  '(author|author_email|author_url)', true );
@@ -139,5 +139,3 @@ function wpcf7_akismet_comment_check( $comment ) {
139
 
140
  return apply_filters( 'wpcf7_akismet_comment_check', $spam, $comment );
141
  }
142
-
143
- ?>
86
  continue;
87
  }
88
 
89
+ if ( $tags = wpcf7_scan_form_tags( array( 'name' => $key ) ) ) {
90
  $tag = $tags[0];
91
+ $tag = new WPCF7_FormTag( $tag );
92
 
93
  $akismet = $tag->get_option( 'akismet',
94
  '(author|author_email|author_url)', true );
139
 
140
  return apply_filters( 'wpcf7_akismet_comment_check', $spam, $comment );
141
  }
 
 
modules/checkbox.php CHANGED
@@ -3,27 +3,29 @@
3
  ** A base module for [checkbox], [checkbox*], and [radio]
4
  **/
5
 
6
- /* Shortcode handler */
7
 
8
- add_action( 'wpcf7_init', 'wpcf7_add_shortcode_checkbox' );
9
 
10
- function wpcf7_add_shortcode_checkbox() {
11
- wpcf7_add_shortcode( array( 'checkbox', 'checkbox*', 'radio' ),
12
- 'wpcf7_checkbox_shortcode_handler', true );
13
  }
14
 
15
- function wpcf7_checkbox_shortcode_handler( $tag ) {
16
- $tag = new WPCF7_Shortcode( $tag );
17
 
18
- if ( empty( $tag->name ) )
19
  return '';
 
20
 
21
  $validation_error = wpcf7_get_validation_error( $tag->name );
22
 
23
  $class = wpcf7_form_controls_class( $tag->type );
24
 
25
- if ( $validation_error )
26
  $class .= ' wpcf7-not-valid';
 
27
 
28
  $label_first = $tag->has_option( 'label_first' );
29
  $use_label_element = $tag->has_option( 'use_label_element' );
@@ -31,13 +33,15 @@ function wpcf7_checkbox_shortcode_handler( $tag ) {
31
  $free_text = $tag->has_option( 'free_text' );
32
  $multiple = false;
33
 
34
- if ( 'checkbox' == $tag->basetype )
35
  $multiple = ! $exclusive;
36
- else // radio
37
  $exclusive = false;
 
38
 
39
- if ( $exclusive )
40
  $class .= ' wpcf7-exclusive-checkbox';
 
41
 
42
  $atts = array();
43
 
@@ -46,8 +50,9 @@ function wpcf7_checkbox_shortcode_handler( $tag ) {
46
 
47
  $tabindex = $tag->get_option( 'tabindex', 'int', true );
48
 
49
- if ( false !== $tabindex )
50
  $tabindex = absint( $tabindex );
 
51
 
52
  $html = '';
53
  $count = 0;
@@ -122,11 +127,11 @@ function wpcf7_checkbox_shortcode_handler( $tag ) {
122
 
123
  if ( $label_first ) { // put label first, input last
124
  $item = sprintf(
125
- '<span class="wpcf7-list-item-label">%1$s</span>&nbsp;<input %2$s />',
126
  esc_html( $label ), $item_atts );
127
  } else {
128
  $item = sprintf(
129
- '<input %2$s />&nbsp;<span class="wpcf7-list-item-label">%1$s</span>',
130
  esc_html( $label ), $item_atts );
131
  }
132
 
@@ -188,7 +193,7 @@ add_filter( 'wpcf7_validate_checkbox*', 'wpcf7_checkbox_validation_filter', 10,
188
  add_filter( 'wpcf7_validate_radio', 'wpcf7_checkbox_validation_filter', 10, 2 );
189
 
190
  function wpcf7_checkbox_validation_filter( $result, $tag ) {
191
- $tag = new WPCF7_Shortcode( $tag );
192
 
193
  $type = $tag->type;
194
  $name = $tag->name;
@@ -208,7 +213,7 @@ function wpcf7_checkbox_validation_filter( $result, $tag ) {
208
  add_filter( 'wpcf7_posted_data', 'wpcf7_checkbox_posted_data' );
209
 
210
  function wpcf7_checkbox_posted_data( $posted_data ) {
211
- $tags = wpcf7_scan_shortcode(
212
  array( 'type' => array( 'checkbox', 'checkbox*', 'radio' ) ) );
213
 
214
  if ( empty( $tags ) ) {
@@ -216,7 +221,7 @@ function wpcf7_checkbox_posted_data( $posted_data ) {
216
  }
217
 
218
  foreach ( $tags as $tag ) {
219
- $tag = new WPCF7_Shortcode( $tag );
220
 
221
  if ( ! isset( $posted_data[$tag->name] ) ) {
222
  continue;
3
  ** A base module for [checkbox], [checkbox*], and [radio]
4
  **/
5
 
6
+ /* form_tag handler */
7
 
8
+ add_action( 'wpcf7_init', 'wpcf7_add_form_tag_checkbox' );
9
 
10
+ function wpcf7_add_form_tag_checkbox() {
11
+ wpcf7_add_form_tag( array( 'checkbox', 'checkbox*', 'radio' ),
12
+ 'wpcf7_checkbox_form_tag_handler', true );
13
  }
14
 
15
+ function wpcf7_checkbox_form_tag_handler( $tag ) {
16
+ $tag = new WPCF7_FormTag( $tag );
17
 
18
+ if ( empty( $tag->name ) ) {
19
  return '';
20
+ }
21
 
22
  $validation_error = wpcf7_get_validation_error( $tag->name );
23
 
24
  $class = wpcf7_form_controls_class( $tag->type );
25
 
26
+ if ( $validation_error ) {
27
  $class .= ' wpcf7-not-valid';
28
+ }
29
 
30
  $label_first = $tag->has_option( 'label_first' );
31
  $use_label_element = $tag->has_option( 'use_label_element' );
33
  $free_text = $tag->has_option( 'free_text' );
34
  $multiple = false;
35
 
36
+ if ( 'checkbox' == $tag->basetype ) {
37
  $multiple = ! $exclusive;
38
+ } else { // radio
39
  $exclusive = false;
40
+ }
41
 
42
+ if ( $exclusive ) {
43
  $class .= ' wpcf7-exclusive-checkbox';
44
+ }
45
 
46
  $atts = array();
47
 
50
 
51
  $tabindex = $tag->get_option( 'tabindex', 'int', true );
52
 
53
+ if ( false !== $tabindex ) {
54
  $tabindex = absint( $tabindex );
55
+ }
56
 
57
  $html = '';
58
  $count = 0;
127
 
128
  if ( $label_first ) { // put label first, input last
129
  $item = sprintf(
130
+ '<span class="wpcf7-list-item-label">%1$s</span><input %2$s />',
131
  esc_html( $label ), $item_atts );
132
  } else {
133
  $item = sprintf(
134
+ '<input %2$s /><span class="wpcf7-list-item-label">%1$s</span>',
135
  esc_html( $label ), $item_atts );
136
  }
137
 
193
  add_filter( 'wpcf7_validate_radio', 'wpcf7_checkbox_validation_filter', 10, 2 );
194
 
195
  function wpcf7_checkbox_validation_filter( $result, $tag ) {
196
+ $tag = new WPCF7_FormTag( $tag );
197
 
198
  $type = $tag->type;
199
  $name = $tag->name;
213
  add_filter( 'wpcf7_posted_data', 'wpcf7_checkbox_posted_data' );
214
 
215
  function wpcf7_checkbox_posted_data( $posted_data ) {
216
+ $tags = wpcf7_scan_form_tags(
217
  array( 'type' => array( 'checkbox', 'checkbox*', 'radio' ) ) );
218
 
219
  if ( empty( $tags ) ) {
221
  }
222
 
223
  foreach ( $tags as $tag ) {
224
+ $tag = new WPCF7_FormTag( $tag );
225
 
226
  if ( ! isset( $posted_data[$tag->name] ) ) {
227
  continue;
modules/count.php CHANGED
@@ -3,27 +3,27 @@
3
  ** A base module for [count], Twitter-like character count
4
  **/
5
 
6
- /* Shortcode handler */
7
 
8
- add_action( 'wpcf7_init', 'wpcf7_add_shortcode_count' );
9
 
10
- function wpcf7_add_shortcode_count() {
11
- wpcf7_add_shortcode( 'count', 'wpcf7_count_shortcode_handler', true );
12
  }
13
 
14
- function wpcf7_count_shortcode_handler( $tag ) {
15
- $tag = new WPCF7_Shortcode( $tag );
16
 
17
  if ( empty( $tag->name ) ) {
18
  return '';
19
  }
20
 
21
- $targets = wpcf7_scan_shortcode( array( 'name' => $tag->name ) );
22
  $maxlength = $minlength = null;
23
 
24
  while ( $targets ) {
25
  $target = array_shift( $targets );
26
- $target = new WPCF7_Shortcode( $target );
27
 
28
  if ( 'count' != $target->type ) {
29
  $maxlength = $target->get_maxlength_option();
3
  ** A base module for [count], Twitter-like character count
4
  **/
5
 
6
+ /* form_tag handler */
7
 
8
+ add_action( 'wpcf7_init', 'wpcf7_add_form_tag_count' );
9
 
10
+ function wpcf7_add_form_tag_count() {
11
+ wpcf7_add_form_tag( 'count', 'wpcf7_count_form_tag_handler', true );
12
  }
13
 
14
+ function wpcf7_count_form_tag_handler( $tag ) {
15
+ $tag = new WPCF7_FormTag( $tag );
16
 
17
  if ( empty( $tag->name ) ) {
18
  return '';
19
  }
20
 
21
+ $targets = wpcf7_scan_form_tags( array( 'name' => $tag->name ) );
22
  $maxlength = $minlength = null;
23
 
24
  while ( $targets ) {
25
  $target = array_shift( $targets );
26
+ $target = new WPCF7_FormTag( $target );
27
 
28
  if ( 'count' != $target->type ) {
29
  $maxlength = $target->get_maxlength_option();
modules/date.php CHANGED
@@ -4,20 +4,21 @@
4
  ** [date] and [date*] # Date
5
  **/
6
 
7
- /* Shortcode handler */
8
 
9
- add_action( 'wpcf7_init', 'wpcf7_add_shortcode_date' );
10
 
11
- function wpcf7_add_shortcode_date() {
12
- wpcf7_add_shortcode( array( 'date', 'date*' ),
13
- 'wpcf7_date_shortcode_handler', true );
14
  }
15
 
16
- function wpcf7_date_shortcode_handler( $tag ) {
17
- $tag = new WPCF7_Shortcode( $tag );
18
 
19
- if ( empty( $tag->name ) )
20
  return '';
 
21
 
22
  $validation_error = wpcf7_get_validation_error( $tag->name );
23
 
@@ -25,8 +26,9 @@ function wpcf7_date_shortcode_handler( $tag ) {
25
 
26
  $class .= ' wpcf7-validates-as-date';
27
 
28
- if ( $validation_error )
29
  $class .= ' wpcf7-not-valid';
 
30
 
31
  $atts = array();
32
 
@@ -37,11 +39,13 @@ function wpcf7_date_shortcode_handler( $tag ) {
37
  $atts['max'] = $tag->get_date_option( 'max' );
38
  $atts['step'] = $tag->get_option( 'step', 'int', true );
39
 
40
- if ( $tag->has_option( 'readonly' ) )
41
  $atts['readonly'] = 'readonly';
 
42
 
43
- if ( $tag->is_required() )
44
  $atts['aria-required'] = 'true';
 
45
 
46
  $atts['aria-invalid'] = $validation_error ? 'true' : 'false';
47
 
@@ -82,7 +86,7 @@ add_filter( 'wpcf7_validate_date', 'wpcf7_date_validation_filter', 10, 2 );
82
  add_filter( 'wpcf7_validate_date*', 'wpcf7_date_validation_filter', 10, 2 );
83
 
84
  function wpcf7_date_validation_filter( $result, $tag ) {
85
- $tag = new WPCF7_Shortcode( $tag );
86
 
87
  $name = $tag->name;
88
 
4
  ** [date] and [date*] # Date
5
  **/
6
 
7
+ /* form_tag handler */
8
 
9
+ add_action( 'wpcf7_init', 'wpcf7_add_form_tag_date' );
10
 
11
+ function wpcf7_add_form_tag_date() {
12
+ wpcf7_add_form_tag( array( 'date', 'date*' ),
13
+ 'wpcf7_date_form_tag_handler', true );
14
  }
15
 
16
+ function wpcf7_date_form_tag_handler( $tag ) {
17
+ $tag = new WPCF7_FormTag( $tag );
18
 
19
+ if ( empty( $tag->name ) ) {
20
  return '';
21
+ }
22
 
23
  $validation_error = wpcf7_get_validation_error( $tag->name );
24
 
26
 
27
  $class .= ' wpcf7-validates-as-date';
28
 
29
+ if ( $validation_error ) {
30
  $class .= ' wpcf7-not-valid';
31
+ }
32
 
33
  $atts = array();
34
 
39
  $atts['max'] = $tag->get_date_option( 'max' );
40
  $atts['step'] = $tag->get_option( 'step', 'int', true );
41
 
42
+ if ( $tag->has_option( 'readonly' ) ) {
43
  $atts['readonly'] = 'readonly';
44
+ }
45
 
46
+ if ( $tag->is_required() ) {
47
  $atts['aria-required'] = 'true';
48
+ }
49
 
50
  $atts['aria-invalid'] = $validation_error ? 'true' : 'false';
51
 
86
  add_filter( 'wpcf7_validate_date*', 'wpcf7_date_validation_filter', 10, 2 );
87
 
88
  function wpcf7_date_validation_filter( $result, $tag ) {
89
+ $tag = new WPCF7_FormTag( $tag );
90
 
91
  $name = $tag->name;
92
 
modules/file.php CHANGED
@@ -3,17 +3,17 @@
3
  ** A base module for [file] and [file*]
4
  **/
5
 
6
- /* Shortcode handler */
7
 
8
- add_action( 'wpcf7_init', 'wpcf7_add_shortcode_file' );
9
 
10
- function wpcf7_add_shortcode_file() {
11
- wpcf7_add_shortcode( array( 'file', 'file*' ),
12
- 'wpcf7_file_shortcode_handler', true );
13
  }
14
 
15
- function wpcf7_file_shortcode_handler( $tag ) {
16
- $tag = new WPCF7_Shortcode( $tag );
17
 
18
  if ( empty( $tag->name ) ) {
19
  return '';
@@ -58,7 +58,7 @@ function wpcf7_file_shortcode_handler( $tag ) {
58
  add_filter( 'wpcf7_form_enctype', 'wpcf7_file_form_enctype_filter' );
59
 
60
  function wpcf7_file_form_enctype_filter( $enctype ) {
61
- $multipart = (bool) wpcf7_scan_shortcode( array( 'type' => array( 'file', 'file*' ) ) );
62
 
63
  if ( $multipart ) {
64
  $enctype = 'multipart/form-data';
@@ -74,7 +74,7 @@ add_filter( 'wpcf7_validate_file', 'wpcf7_file_validation_filter', 10, 2 );
74
  add_filter( 'wpcf7_validate_file*', 'wpcf7_file_validation_filter', 10, 2 );
75
 
76
  function wpcf7_file_validation_filter( $result, $tag ) {
77
- $tag = new WPCF7_Shortcode( $tag );
78
 
79
  $name = $tag->name;
80
  $id = $tag->get_id_option();
@@ -303,7 +303,7 @@ function wpcf7_file_display_warning_message() {
303
  return;
304
  }
305
 
306
- $has_tags = (bool) $contact_form->form_scan_shortcode(
307
  array( 'type' => array( 'file', 'file*' ) ) );
308
 
309
  if ( ! $has_tags ) {
3
  ** A base module for [file] and [file*]
4
  **/
5
 
6
+ /* form_tag handler */
7
 
8
+ add_action( 'wpcf7_init', 'wpcf7_add_form_tag_file' );
9
 
10
+ function wpcf7_add_form_tag_file() {
11
+ wpcf7_add_form_tag( array( 'file', 'file*' ),
12
+ 'wpcf7_file_form_tag_handler', true );
13
  }
14
 
15
+ function wpcf7_file_form_tag_handler( $tag ) {
16
+ $tag = new WPCF7_FormTag( $tag );
17
 
18
  if ( empty( $tag->name ) ) {
19
  return '';
58
  add_filter( 'wpcf7_form_enctype', 'wpcf7_file_form_enctype_filter' );
59
 
60
  function wpcf7_file_form_enctype_filter( $enctype ) {
61
+ $multipart = (bool) wpcf7_scan_form_tags( array( 'type' => array( 'file', 'file*' ) ) );
62
 
63
  if ( $multipart ) {
64
  $enctype = 'multipart/form-data';
74
  add_filter( 'wpcf7_validate_file*', 'wpcf7_file_validation_filter', 10, 2 );
75
 
76
  function wpcf7_file_validation_filter( $result, $tag ) {
77
+ $tag = new WPCF7_FormTag( $tag );
78
 
79
  $name = $tag->name;
80
  $id = $tag->get_id_option();
303
  return;
304
  }
305
 
306
+ $has_tags = (bool) $contact_form->scan_form_tags(
307
  array( 'type' => array( 'file', 'file*' ) ) );
308
 
309
  if ( ! $has_tags ) {
modules/flamingo.php CHANGED
@@ -31,7 +31,7 @@ function wpcf7_flamingo_submit( $contactform, $result ) {
31
  return;
32
  }
33
 
34
- $fields_senseless = $contactform->form_scan_shortcode(
35
  array( 'type' => array( 'captchar', 'quiz', 'acceptance' ) ) );
36
 
37
  $exclude_names = array();
@@ -127,8 +127,9 @@ function wpcf7_flamingo_get_value( $field, $contactform ) {
127
  }
128
 
129
  function wpcf7_flamingo_add_channel( $slug, $name = '' ) {
130
- if ( ! class_exists( 'Flamingo_Inbound_Message' ) )
131
  return false;
 
132
 
133
  $parent = term_exists( 'contact-form-7',
134
  Flamingo_Inbound_Message::channel_taxonomy );
@@ -170,3 +171,30 @@ function wpcf7_flamingo_add_channel( $slug, $name = '' ) {
170
 
171
  return (int) $channel['term_id'];
172
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  return;
32
  }
33
 
34
+ $fields_senseless = $contactform->scan_form_tags(
35
  array( 'type' => array( 'captchar', 'quiz', 'acceptance' ) ) );
36
 
37
  $exclude_names = array();
127
  }
128
 
129
  function wpcf7_flamingo_add_channel( $slug, $name = '' ) {
130
+ if ( ! class_exists( 'Flamingo_Inbound_Message' ) ) {
131
  return false;
132
+ }
133
 
134
  $parent = term_exists( 'contact-form-7',
135
  Flamingo_Inbound_Message::channel_taxonomy );
171
 
172
  return (int) $channel['term_id'];
173
  }
174
+
175
+ add_filter( 'wpcf7_special_mail_tags', 'wpcf7_flamingo_serial_number', 10, 3 );
176
+
177
+ function wpcf7_flamingo_serial_number( $output, $name, $html ) {
178
+ if ( '_serial_number' != $name ) {
179
+ return $output;
180
+ }
181
+
182
+ if ( ! class_exists( 'Flamingo_Inbound_Message' )
183
+ || ! method_exists( 'Flamingo_Inbound_Message', 'count' ) ) {
184
+ return $output;
185
+ }
186
+
187
+ if ( ! $contact_form = WPCF7_ContactForm::get_current() ) {
188
+ return $output;
189
+ }
190
+
191
+ $channel_id = wpcf7_flamingo_add_channel(
192
+ $contact_form->name(), $contact_form->title() );
193
+
194
+ if ( $channel_id ) {
195
+ return 1 + (int) Flamingo_Inbound_Message::count(
196
+ array( 'channel_id' => $channel_id ) );
197
+ }
198
+
199
+ return 0;
200
+ }
modules/hidden.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ add_action( 'wpcf7_init', 'wpcf7_add_form_tag_hidden' );
4
+
5
+ function wpcf7_add_form_tag_hidden() {
6
+ wpcf7_add_form_tag( 'hidden', 'wpcf7_hidden_form_tag_handler', true );
7
+ }
8
+
9
+ function wpcf7_hidden_form_tag_handler( $tag ) {
10
+ $tag = new WPCF7_FormTag( $tag );
11
+
12
+ if ( empty( $tag->name ) ) {
13
+ return '';
14
+ }
15
+
16
+ $atts = array();
17
+
18
+ $class = wpcf7_form_controls_class( $tag->type );
19
+ $atts['class'] = $tag->get_class_option( $class );
20
+ $atts['id'] = $tag->get_id_option();
21
+
22
+ $value = (string) reset( $tag->values );
23
+ $value = $tag->get_default_option( $value );
24
+ $atts['value'] = $value;
25
+
26
+ $atts['type'] = 'hidden';
27
+ $atts['name'] = $tag->name;
28
+ $atts = wpcf7_format_atts( $atts );
29
+
30
+ $html = sprintf( '<input %s />', $atts );
31
+ return $html;
32
+ }
modules/listo.php CHANGED
@@ -28,5 +28,3 @@ function wpcf7_listo( $data, $options, $args ) {
28
 
29
  return $data;
30
  }
31
-
32
- ?>
28
 
29
  return $data;
30
  }
 
 
modules/number.php CHANGED
@@ -5,20 +5,21 @@
5
  ** [range] and [range*] # Range
6
  **/
7
 
8
- /* Shortcode handler */
9
 
10
- add_action( 'wpcf7_init', 'wpcf7_add_shortcode_number' );
11
 
12
- function wpcf7_add_shortcode_number() {
13
- wpcf7_add_shortcode( array( 'number', 'number*', 'range', 'range*' ),
14
- 'wpcf7_number_shortcode_handler', true );
15
  }
16
 
17
- function wpcf7_number_shortcode_handler( $tag ) {
18
- $tag = new WPCF7_Shortcode( $tag );
19
 
20
- if ( empty( $tag->name ) )
21
  return '';
 
22
 
23
  $validation_error = wpcf7_get_validation_error( $tag->name );
24
 
@@ -26,8 +27,9 @@ function wpcf7_number_shortcode_handler( $tag ) {
26
 
27
  $class .= ' wpcf7-validates-as-number';
28
 
29
- if ( $validation_error )
30
  $class .= ' wpcf7-not-valid';
 
31
 
32
  $atts = array();
33
 
@@ -38,11 +40,13 @@ function wpcf7_number_shortcode_handler( $tag ) {
38
  $atts['max'] = $tag->get_option( 'max', 'signed_int', true );
39
  $atts['step'] = $tag->get_option( 'step', 'int', true );
40
 
41
- if ( $tag->has_option( 'readonly' ) )
42
  $atts['readonly'] = 'readonly';
 
43
 
44
- if ( $tag->is_required() )
45
  $atts['aria-required'] = 'true';
 
46
 
47
  $atts['aria-invalid'] = $validation_error ? 'true' : 'false';
48
 
@@ -85,7 +89,7 @@ add_filter( 'wpcf7_validate_range', 'wpcf7_number_validation_filter', 10, 2 );
85
  add_filter( 'wpcf7_validate_range*', 'wpcf7_number_validation_filter', 10, 2 );
86
 
87
  function wpcf7_number_validation_filter( $result, $tag ) {
88
- $tag = new WPCF7_Shortcode( $tag );
89
 
90
  $name = $tag->name;
91
 
5
  ** [range] and [range*] # Range
6
  **/
7
 
8
+ /* form_tag handler */
9
 
10
+ add_action( 'wpcf7_init', 'wpcf7_add_form_tag_number' );
11
 
12
+ function wpcf7_add_form_tag_number() {
13
+ wpcf7_add_form_tag( array( 'number', 'number*', 'range', 'range*' ),
14
+ 'wpcf7_number_form_tag_handler', true );
15
  }
16
 
17
+ function wpcf7_number_form_tag_handler( $tag ) {
18
+ $tag = new WPCF7_FormTag( $tag );
19
 
20
+ if ( empty( $tag->name ) ) {
21
  return '';
22
+ }
23
 
24
  $validation_error = wpcf7_get_validation_error( $tag->name );
25
 
27
 
28
  $class .= ' wpcf7-validates-as-number';
29
 
30
+ if ( $validation_error ) {
31
  $class .= ' wpcf7-not-valid';
32
+ }
33
 
34
  $atts = array();
35
 
40
  $atts['max'] = $tag->get_option( 'max', 'signed_int', true );
41
  $atts['step'] = $tag->get_option( 'step', 'int', true );
42
 
43
+ if ( $tag->has_option( 'readonly' ) ) {
44
  $atts['readonly'] = 'readonly';
45
+ }
46
 
47
+ if ( $tag->is_required() ) {
48
  $atts['aria-required'] = 'true';
49
+ }
50
 
51
  $atts['aria-invalid'] = $validation_error ? 'true' : 'false';
52
 
89
  add_filter( 'wpcf7_validate_range*', 'wpcf7_number_validation_filter', 10, 2 );
90
 
91
  function wpcf7_number_validation_filter( $result, $tag ) {
92
+ $tag = new WPCF7_FormTag( $tag );
93
 
94
  $name = $tag->name;
95
 
modules/quiz.php CHANGED
@@ -3,16 +3,16 @@
3
  ** A base module for [quiz]
4
  **/
5
 
6
- /* Shortcode handler */
7
 
8
- add_action( 'wpcf7_init', 'wpcf7_add_shortcode_quiz' );
9
 
10
- function wpcf7_add_shortcode_quiz() {
11
- wpcf7_add_shortcode( 'quiz', 'wpcf7_quiz_shortcode_handler', true );
12
  }
13
 
14
- function wpcf7_quiz_shortcode_handler( $tag ) {
15
- $tag = new WPCF7_Shortcode( $tag );
16
 
17
  if ( empty( $tag->name ) ) {
18
  return '';
@@ -77,7 +77,7 @@ function wpcf7_quiz_shortcode_handler( $tag ) {
77
  add_filter( 'wpcf7_validate_quiz', 'wpcf7_quiz_validation_filter', 10, 2 );
78
 
79
  function wpcf7_quiz_validation_filter( $result, $tag ) {
80
- $tag = new WPCF7_Shortcode( $tag );
81
 
82
  $name = $tag->name;
83
 
@@ -107,7 +107,7 @@ function wpcf7_quiz_ajax_refill( $items ) {
107
  if ( ! is_array( $items ) )
108
  return $items;
109
 
110
- $fes = wpcf7_scan_shortcode( array( 'type' => 'quiz' ) );
111
 
112
  if ( empty( $fes ) )
113
  return $items;
3
  ** A base module for [quiz]
4
  **/
5
 
6
+ /* form_tag handler */
7
 
8
+ add_action( 'wpcf7_init', 'wpcf7_add_form_tag_quiz' );
9
 
10
+ function wpcf7_add_form_tag_quiz() {
11
+ wpcf7_add_form_tag( 'quiz', 'wpcf7_quiz_form_tag_handler', true );
12
  }
13
 
14
+ function wpcf7_quiz_form_tag_handler( $tag ) {
15
+ $tag = new WPCF7_FormTag( $tag );
16
 
17
  if ( empty( $tag->name ) ) {
18
  return '';
77
  add_filter( 'wpcf7_validate_quiz', 'wpcf7_quiz_validation_filter', 10, 2 );
78
 
79
  function wpcf7_quiz_validation_filter( $result, $tag ) {
80
+ $tag = new WPCF7_FormTag( $tag );
81
 
82
  $name = $tag->name;
83
 
107
  if ( ! is_array( $items ) )
108
  return $items;
109
 
110
+ $fes = wpcf7_scan_form_tags( array( 'type' => 'quiz' ) );
111
 
112
  if ( empty( $fes ) )
113
  return $items;
modules/really-simple-captcha.php CHANGED
@@ -3,17 +3,17 @@
3
  ** A base module for [captchac] and [captchar]
4
  **/
5
 
6
- /* Shortcode handler */
7
 
8
- add_action( 'wpcf7_init', 'wpcf7_add_shortcode_captcha' );
9
 
10
- function wpcf7_add_shortcode_captcha() {
11
- wpcf7_add_shortcode( array( 'captchac', 'captchar' ),
12
- 'wpcf7_captcha_shortcode_handler', true );
13
  }
14
 
15
- function wpcf7_captcha_shortcode_handler( $tag ) {
16
- $tag = new WPCF7_Shortcode( $tag );
17
 
18
  if ( 'captchac' == $tag->type && ! class_exists( 'ReallySimpleCaptcha' ) ) {
19
  return '<em>' . __( 'To use CAPTCHA, you need <a href="http://wordpress.org/extend/plugins/really-simple-captcha/">Really Simple CAPTCHA</a> plugin installed.', 'contact-form-7' ) . '</em>';
@@ -124,7 +124,7 @@ function wpcf7_captcha_shortcode_handler( $tag ) {
124
  add_filter( 'wpcf7_validate_captchar', 'wpcf7_captcha_validation_filter', 10, 2 );
125
 
126
  function wpcf7_captcha_validation_filter( $result, $tag ) {
127
- $tag = new WPCF7_Shortcode( $tag );
128
 
129
  $type = $tag->type;
130
  $name = $tag->name;
@@ -156,7 +156,7 @@ function wpcf7_captcha_ajax_refill( $items ) {
156
  if ( ! is_array( $items ) )
157
  return $items;
158
 
159
- $fes = wpcf7_scan_shortcode( array( 'type' => 'captchac' ) );
160
 
161
  if ( empty( $fes ) )
162
  return $items;
@@ -296,7 +296,7 @@ function wpcf7_captcha_display_warning_message() {
296
  return;
297
  }
298
 
299
- $has_tags = (bool) $contact_form->form_scan_shortcode(
300
  array( 'type' => array( 'captchac' ) ) );
301
 
302
  if ( ! $has_tags ) {
3
  ** A base module for [captchac] and [captchar]
4
  **/
5
 
6
+ /* form_tag handler */
7
 
8
+ add_action( 'wpcf7_init', 'wpcf7_add_form_tag_captcha' );
9
 
10
+ function wpcf7_add_form_tag_captcha() {
11
+ wpcf7_add_form_tag( array( 'captchac', 'captchar' ),
12
+ 'wpcf7_captcha_form_tag_handler', true );
13
  }
14
 
15
+ function wpcf7_captcha_form_tag_handler( $tag ) {
16
+ $tag = new WPCF7_FormTag( $tag );
17
 
18
  if ( 'captchac' == $tag->type && ! class_exists( 'ReallySimpleCaptcha' ) ) {
19
  return '<em>' . __( 'To use CAPTCHA, you need <a href="http://wordpress.org/extend/plugins/really-simple-captcha/">Really Simple CAPTCHA</a> plugin installed.', 'contact-form-7' ) . '</em>';
124
  add_filter( 'wpcf7_validate_captchar', 'wpcf7_captcha_validation_filter', 10, 2 );
125
 
126
  function wpcf7_captcha_validation_filter( $result, $tag ) {
127
+ $tag = new WPCF7_FormTag( $tag );
128
 
129
  $type = $tag->type;
130
  $name = $tag->name;
156
  if ( ! is_array( $items ) )
157
  return $items;
158
 
159
+ $fes = wpcf7_scan_form_tags( array( 'type' => 'captchac' ) );
160
 
161
  if ( empty( $fes ) )
162
  return $items;
296
  return;
297
  }
298
 
299
+ $has_tags = (bool) $contact_form->scan_form_tags(
300
  array( 'type' => array( 'captchac' ) ) );
301
 
302
  if ( ! $has_tags ) {
modules/recaptcha.php CHANGED
@@ -292,20 +292,20 @@ var recaptchaCallback = function() {
292
  <?php
293
  }
294
 
295
- add_action( 'wpcf7_init', 'wpcf7_recaptcha_add_shortcode_recaptcha' );
296
 
297
- function wpcf7_recaptcha_add_shortcode_recaptcha() {
298
  $recaptcha = WPCF7_RECAPTCHA::get_instance();
299
 
300
  if ( $recaptcha->is_active() ) {
301
- wpcf7_add_shortcode( 'recaptcha', 'wpcf7_recaptcha_shortcode_handler' );
302
  }
303
  }
304
 
305
- function wpcf7_recaptcha_shortcode_handler( $tag ) {
306
  wp_enqueue_script( 'google-recaptcha' );
307
 
308
- $tag = new WPCF7_Shortcode( $tag );
309
 
310
  $atts = array();
311
 
@@ -376,7 +376,7 @@ function wpcf7_recaptcha_check_with_google( $spam ) {
376
  return $spam;
377
  }
378
 
379
- $tags = $contact_form->form_scan_shortcode( array( 'type' => 'recaptcha' ) );
380
 
381
  if ( empty( $tags ) ) {
382
  return $spam;
292
  <?php
293
  }
294
 
295
+ add_action( 'wpcf7_init', 'wpcf7_recaptcha_add_form_tag_recaptcha' );
296
 
297
+ function wpcf7_recaptcha_add_form_tag_recaptcha() {
298
  $recaptcha = WPCF7_RECAPTCHA::get_instance();
299
 
300
  if ( $recaptcha->is_active() ) {
301
+ wpcf7_add_form_tag( 'recaptcha', 'wpcf7_recaptcha_form_tag_handler' );
302
  }
303
  }
304
 
305
+ function wpcf7_recaptcha_form_tag_handler( $tag ) {
306
  wp_enqueue_script( 'google-recaptcha' );
307
 
308
+ $tag = new WPCF7_FormTag( $tag );
309
 
310
  $atts = array();
311
 
376
  return $spam;
377
  }
378
 
379
+ $tags = $contact_form->scan_form_tags( array( 'type' => 'recaptcha' ) );
380
 
381
  if ( empty( $tags ) ) {
382
  return $spam;
modules/response.php CHANGED
@@ -3,14 +3,16 @@
3
  ** A base module for [response]
4
  **/
5
 
6
- /* Shortcode handler */
7
 
8
- wpcf7_add_shortcode( 'response', 'wpcf7_response_shortcode_handler' );
9
 
10
- function wpcf7_response_shortcode_handler( $tag ) {
 
 
 
 
11
  if ( $contact_form = wpcf7_get_current_contact_form() ) {
12
  return $contact_form->form_response_output();
13
  }
14
  }
15
-
16
- ?>
3
  ** A base module for [response]
4
  **/
5
 
6
+ /* form_tag handler */
7
 
8
+ add_action( 'wpcf7_init', 'wpcf7_add_form_tag_response' );
9
 
10
+ function wpcf7_add_form_tag_response() {
11
+ wpcf7_add_form_tag( 'response', 'wpcf7_response_form_tag_handler' );
12
+ }
13
+
14
+ function wpcf7_response_form_tag_handler( $tag ) {
15
  if ( $contact_form = wpcf7_get_current_contact_form() ) {
16
  return $contact_form->form_response_output();
17
  }
18
  }
 
 
modules/select.php CHANGED
@@ -3,27 +3,29 @@
3
  ** A base module for [select] and [select*]
4
  **/
5
 
6
- /* Shortcode handler */
7
 
8
- add_action( 'wpcf7_init', 'wpcf7_add_shortcode_select' );
9
 
10
- function wpcf7_add_shortcode_select() {
11
- wpcf7_add_shortcode( array( 'select', 'select*' ),
12
- 'wpcf7_select_shortcode_handler', true );
13
  }
14
 
15
- function wpcf7_select_shortcode_handler( $tag ) {
16
- $tag = new WPCF7_Shortcode( $tag );
17
 
18
- if ( empty( $tag->name ) )
19
  return '';
 
20
 
21
  $validation_error = wpcf7_get_validation_error( $tag->name );
22
 
23
  $class = wpcf7_form_controls_class( $tag->type );
24
 
25
- if ( $validation_error )
26
  $class .= ' wpcf7-not-valid';
 
27
 
28
  $atts = array();
29
 
@@ -31,8 +33,9 @@ function wpcf7_select_shortcode_handler( $tag ) {
31
  $atts['id'] = $tag->get_id_option();
32
  $atts['tabindex'] = $tag->get_option( 'tabindex', 'int', true );
33
 
34
- if ( $tag->is_required() )
35
  $atts['aria-required'] = 'true';
 
36
 
37
  $atts['aria-invalid'] = $validation_error ? 'true' : 'false';
38
 
@@ -129,7 +132,7 @@ add_filter( 'wpcf7_validate_select', 'wpcf7_select_validation_filter', 10, 2 );
129
  add_filter( 'wpcf7_validate_select*', 'wpcf7_select_validation_filter', 10, 2 );
130
 
131
  function wpcf7_select_validation_filter( $result, $tag ) {
132
- $tag = new WPCF7_Shortcode( $tag );
133
 
134
  $name = $tag->name;
135
 
3
  ** A base module for [select] and [select*]
4
  **/
5
 
6
+ /* form_tag handler */
7
 
8
+ add_action( 'wpcf7_init', 'wpcf7_add_form_tag_select' );
9
 
10
+ function wpcf7_add_form_tag_select() {
11
+ wpcf7_add_form_tag( array( 'select', 'select*' ),
12
+ 'wpcf7_select_form_tag_handler', true );
13
  }
14
 
15
+ function wpcf7_select_form_tag_handler( $tag ) {
16
+ $tag = new WPCF7_FormTag( $tag );
17
 
18
+ if ( empty( $tag->name ) ) {
19
  return '';
20
+ }
21
 
22
  $validation_error = wpcf7_get_validation_error( $tag->name );
23
 
24
  $class = wpcf7_form_controls_class( $tag->type );
25
 
26
+ if ( $validation_error ) {
27
  $class .= ' wpcf7-not-valid';
28
+ }
29
 
30
  $atts = array();
31
 
33
  $atts['id'] = $tag->get_id_option();
34
  $atts['tabindex'] = $tag->get_option( 'tabindex', 'int', true );
35
 
36
+ if ( $tag->is_required() ) {
37
  $atts['aria-required'] = 'true';
38
+ }
39
 
40
  $atts['aria-invalid'] = $validation_error ? 'true' : 'false';
41
 
132
  add_filter( 'wpcf7_validate_select*', 'wpcf7_select_validation_filter', 10, 2 );
133
 
134
  function wpcf7_select_validation_filter( $result, $tag ) {
135
+ $tag = new WPCF7_FormTag( $tag );
136
 
137
  $name = $tag->name;
138
 
modules/submit.php CHANGED
@@ -3,16 +3,16 @@
3
  ** A base module for [submit]
4
  **/
5
 
6
- /* Shortcode handler */
7
 
8
- add_action( 'wpcf7_init', 'wpcf7_add_shortcode_submit' );
9
 
10
- function wpcf7_add_shortcode_submit() {
11
- wpcf7_add_shortcode( 'submit', 'wpcf7_submit_shortcode_handler' );
12
  }
13
 
14
- function wpcf7_submit_shortcode_handler( $tag ) {
15
- $tag = new WPCF7_Shortcode( $tag );
16
 
17
  $class = wpcf7_form_controls_class( $tag->type );
18
 
@@ -24,8 +24,9 @@ function wpcf7_submit_shortcode_handler( $tag ) {
24
 
25
  $value = isset( $tag->values[0] ) ? $tag->values[0] : '';
26
 
27
- if ( empty( $value ) )
28
  $value = __( 'Send', 'contact-form-7' );
 
29
 
30
  $atts['type'] = 'submit';
31
  $atts['value'] = $value;
3
  ** A base module for [submit]
4
  **/
5
 
6
+ /* form_tag handler */
7
 
8
+ add_action( 'wpcf7_init', 'wpcf7_add_form_tag_submit' );
9
 
10
+ function wpcf7_add_form_tag_submit() {
11
+ wpcf7_add_form_tag( 'submit', 'wpcf7_submit_form_tag_handler' );
12
  }
13
 
14
+ function wpcf7_submit_form_tag_handler( $tag ) {
15
+ $tag = new WPCF7_FormTag( $tag );
16
 
17
  $class = wpcf7_form_controls_class( $tag->type );
18
 
24
 
25
  $value = isset( $tag->values[0] ) ? $tag->values[0] : '';
26
 
27
+ if ( empty( $value ) ) {
28
  $value = __( 'Send', 'contact-form-7' );
29
+ }
30
 
31
  $atts['type'] = 'submit';
32
  $atts['value'] = $value;
modules/text.php CHANGED
@@ -7,18 +7,18 @@
7
  ** [tel] and [tel*] # Telephone number
8
  **/
9
 
10
- /* Shortcode handler */
11
 
12
- add_action( 'wpcf7_init', 'wpcf7_add_shortcode_text' );
13
 
14
- function wpcf7_add_shortcode_text() {
15
- wpcf7_add_shortcode(
16
  array( 'text', 'text*', 'email', 'email*', 'url', 'url*', 'tel', 'tel*' ),
17
- 'wpcf7_text_shortcode_handler', true );
18
  }
19
 
20
- function wpcf7_text_shortcode_handler( $tag ) {
21
- $tag = new WPCF7_Shortcode( $tag );
22
 
23
  if ( empty( $tag->name ) ) {
24
  return '';
@@ -107,7 +107,7 @@ add_filter( 'wpcf7_validate_tel', 'wpcf7_text_validation_filter', 10, 2 );
107
  add_filter( 'wpcf7_validate_tel*', 'wpcf7_text_validation_filter', 10, 2 );
108
 
109
  function wpcf7_text_validation_filter( $result, $tag ) {
110
- $tag = new WPCF7_Shortcode( $tag );
111
 
112
  $name = $tag->name;
113
 
7
  ** [tel] and [tel*] # Telephone number
8
  **/
9
 
10
+ /* form_tag handler */
11
 
12
+ add_action( 'wpcf7_init', 'wpcf7_add_form_tag_text' );
13
 
14
+ function wpcf7_add_form_tag_text() {
15
+ wpcf7_add_form_tag(
16
  array( 'text', 'text*', 'email', 'email*', 'url', 'url*', 'tel', 'tel*' ),
17
+ 'wpcf7_text_form_tag_handler', true );
18
  }
19
 
20
+ function wpcf7_text_form_tag_handler( $tag ) {
21
+ $tag = new WPCF7_FormTag( $tag );
22
 
23
  if ( empty( $tag->name ) ) {
24
  return '';
107
  add_filter( 'wpcf7_validate_tel*', 'wpcf7_text_validation_filter', 10, 2 );
108
 
109
  function wpcf7_text_validation_filter( $result, $tag ) {
110
+ $tag = new WPCF7_FormTag( $tag );
111
 
112
  $name = $tag->name;
113
 
modules/textarea.php CHANGED
@@ -3,17 +3,17 @@
3
  ** A base module for [textarea] and [textarea*]
4
  **/
5
 
6
- /* Shortcode handler */
7
 
8
- add_action( 'wpcf7_init', 'wpcf7_add_shortcode_textarea' );
9
 
10
- function wpcf7_add_shortcode_textarea() {
11
- wpcf7_add_shortcode( array( 'textarea', 'textarea*' ),
12
- 'wpcf7_textarea_shortcode_handler', true );
13
  }
14
 
15
- function wpcf7_textarea_shortcode_handler( $tag ) {
16
- $tag = new WPCF7_Shortcode( $tag );
17
 
18
  if ( empty( $tag->name ) ) {
19
  return '';
@@ -87,7 +87,7 @@ add_filter( 'wpcf7_validate_textarea', 'wpcf7_textarea_validation_filter', 10, 2
87
  add_filter( 'wpcf7_validate_textarea*', 'wpcf7_textarea_validation_filter', 10, 2 );
88
 
89
  function wpcf7_textarea_validation_filter( $result, $tag ) {
90
- $tag = new WPCF7_Shortcode( $tag );
91
 
92
  $type = $tag->type;
93
  $name = $tag->name;
3
  ** A base module for [textarea] and [textarea*]
4
  **/
5
 
6
+ /* form_tag handler */
7
 
8
+ add_action( 'wpcf7_init', 'wpcf7_add_form_tag_textarea' );
9
 
10
+ function wpcf7_add_form_tag_textarea() {
11
+ wpcf7_add_form_tag( array( 'textarea', 'textarea*' ),
12
+ 'wpcf7_textarea_form_tag_handler', true );
13
  }
14
 
15
+ function wpcf7_textarea_form_tag_handler( $tag ) {
16
+ $tag = new WPCF7_FormTag( $tag );
17
 
18
  if ( empty( $tag->name ) ) {
19
  return '';
87
  add_filter( 'wpcf7_validate_textarea*', 'wpcf7_textarea_validation_filter', 10, 2 );
88
 
89
  function wpcf7_textarea_validation_filter( $result, $tag ) {
90
+ $tag = new WPCF7_FormTag( $tag );
91
 
92
  $type = $tag->type;
93
  $name = $tag->name;
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: takayukister
3
  Donate link: http://contactform7.com/donate/
4
  Tags: contact, form, contact form, feedback, email, ajax, captcha, akismet, multilingual
5
- Requires at least: 4.4
6
- Tested up to: 4.6.1
7
- Stable tag: 4.5.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -62,6 +62,16 @@ Do you have questions or issues with Contact Form 7? Use these support channels
62
 
63
  For more information, see [Releases](http://contactform7.com/category/releases/).
64
 
 
 
 
 
 
 
 
 
 
 
65
  = 4.5.1 =
66
 
67
  * Avoids JavaScript strict-mode errors seen with ill-designed themes.
2
  Contributors: takayukister
3
  Donate link: http://contactform7.com/donate/
4
  Tags: contact, form, contact form, feedback, email, ajax, captcha, akismet, multilingual
5
+ Requires at least: 4.5
6
+ Tested up to: 4.7
7
+ Stable tag: 4.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
62
 
63
  For more information, see [Releases](http://contactform7.com/category/releases/).
64
 
65
+ = 4.6 =
66
+
67
+ * Ajax loader: HTML markup changed to `<span>` to be easily customizable with CSS.
68
+ * Appends a proper header and footer to HTML mail content automatically.
69
+ * `[_serial_number]` special mail-tag.
70
+ * New form-tag type for hidden fields.
71
+ * `default:shortcode_attr` form-tag option.
72
+ * `WPCF7_Shortcode`, `WPCF7_ShortcodeManager`, `wpcf7_add_shortcode()`, `wpcf7_scan_shortcode()`, and some other classes and functions have become deprecated.
73
+ * Removed all language files from the _languages_ folder. Translations have moved to [translate.wordpress.org](https://translate.wordpress.org/projects/wp-plugins/contact-form-7).
74
+
75
  = 4.5.1 =
76
 
77
  * Avoids JavaScript strict-mode errors seen with ill-designed themes.
settings.php CHANGED
@@ -4,6 +4,8 @@ require_once WPCF7_PLUGIN_DIR . '/includes/functions.php';
4
  require_once WPCF7_PLUGIN_DIR . '/includes/l10n.php';
5
  require_once WPCF7_PLUGIN_DIR . '/includes/formatting.php';
6
  require_once WPCF7_PLUGIN_DIR . '/includes/pipe.php';
 
 
7
  require_once WPCF7_PLUGIN_DIR . '/includes/shortcodes.php';
8
  require_once WPCF7_PLUGIN_DIR . '/includes/capabilities.php';
9
  require_once WPCF7_PLUGIN_DIR . '/includes/contact-form-template.php';
@@ -40,6 +42,7 @@ class WPCF7 {
40
  self::load_module( 'submit' );
41
  self::load_module( 'text' );
42
  self::load_module( 'textarea' );
 
43
  }
44
 
45
  protected static function load_module( $mod ) {
4
  require_once WPCF7_PLUGIN_DIR . '/includes/l10n.php';
5
  require_once WPCF7_PLUGIN_DIR . '/includes/formatting.php';
6
  require_once WPCF7_PLUGIN_DIR . '/includes/pipe.php';
7
+ require_once WPCF7_PLUGIN_DIR . '/includes/form-tag.php';
8
+ require_once WPCF7_PLUGIN_DIR . '/includes/form-tags-manager.php';
9
  require_once WPCF7_PLUGIN_DIR . '/includes/shortcodes.php';
10
  require_once WPCF7_PLUGIN_DIR . '/includes/capabilities.php';
11
  require_once WPCF7_PLUGIN_DIR . '/includes/contact-form-template.php';
42
  self::load_module( 'submit' );
43
  self::load_module( 'text' );
44
  self::load_module( 'textarea' );
45
+ self::load_module( 'hidden' );
46
  }
47
 
48
  protected static function load_module( $mod ) {
uninstall.php CHANGED
@@ -1,7 +1,8 @@
1
  <?php
2
 
3
- if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) )
4
  exit();
 
5
 
6
  function wpcf7_delete_plugin() {
7
  global $wpdb;
@@ -13,14 +14,12 @@ function wpcf7_delete_plugin() {
13
  'post_type' => 'wpcf7_contact_form',
14
  'post_status' => 'any' ) );
15
 
16
- foreach ( $posts as $post )
17
  wp_delete_post( $post->ID, true );
 
18
 
19
- $table_name = $wpdb->prefix . "contact_form_7";
20
-
21
- $wpdb->query( "DROP TABLE IF EXISTS $table_name" );
22
  }
23
 
24
  wpcf7_delete_plugin();
25
-
26
- ?>
1
  <?php
2
 
3
+ if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
4
  exit();
5
+ }
6
 
7
  function wpcf7_delete_plugin() {
8
  global $wpdb;
14
  'post_type' => 'wpcf7_contact_form',
15
  'post_status' => 'any' ) );
16
 
17
+ foreach ( $posts as $post ) {
18
  wp_delete_post( $post->ID, true );
19
+ }
20
 
21
+ $wpdb->query( sprintf( "DROP TABLE IF EXISTS %s",
22
+ $wpdb->prefix . 'contact_form_7' ) );
 
23
  }
24
 
25
  wpcf7_delete_plugin();
 
 
wp-contact-form-7.php CHANGED
@@ -7,12 +7,12 @@ Author: Takayuki Miyoshi
7
  Author URI: http://ideasilo.wordpress.com/
8
  Text Domain: contact-form-7
9
  Domain Path: /languages/
10
- Version: 4.5.1
11
  */
12
 
13
- define( 'WPCF7_VERSION', '4.5.1' );
14
 
15
- define( 'WPCF7_REQUIRED_WP_VERSION', '4.4' );
16
 
17
  define( 'WPCF7_PLUGIN', __FILE__ );
18
 
7
  Author URI: http://ideasilo.wordpress.com/
8
  Text Domain: contact-form-7
9
  Domain Path: /languages/
10
+ Version: 4.6
11
  */
12
 
13
+ define( 'WPCF7_VERSION', '4.6' );
14
 
15
+ define( 'WPCF7_REQUIRED_WP_VERSION', '4.5' );
16
 
17
  define( 'WPCF7_PLUGIN', __FILE__ );
18