Advertisement
Guest User

Contact Form Submission Plugin CSV Export Fix

a guest
Jun 20th, 2017
540
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.32 KB | None | 0 0
  1. From 4052e4463d14f1516cc5a0efb7a0999960d515b0 Mon Sep 17 00:00:00 2001
  2. From: Daniel Schultheis <d.schultheis@reizwerk.com>
  3. Date: Tue, 20 Jun 2017 10:20:41 +0200
  4. Subject: [PATCH] Fixed Contact Form Submission plugin CSV export. Will now
  5.  save and export empty fields correctly.
  6.  
  7. ---
  8. .../wp-content/plugins/contact-form-submissions/Submissions.php      | 5 +++--
  9.  1 file changed, 3 insertions(+), 2 deletions(-)
  10.  
  11. diff --git a/wordpress/wp-content/plugins/contact-form-submissions/Submissions.php b/wordpress/wp-content/plugins/contact-form-submissions/Submissions.php
  12. index 7286354..954d999 100644
  13. --- a/wordpress/wp-content/plugins/contact-form-submissions/Submissions.php
  14. +++ b/wordpress/wp-content/plugins/contact-form-submissions/Submissions.php
  15. @@ -157,9 +157,10 @@ class WPCF7Submissions
  16.              $additional_fields = $submission['fields'];
  17.              if (!empty($additional_fields)) {
  18.                  foreach ($additional_fields as $name => $value) {
  19. -                    if (!empty($value)) {
  20. -                        add_post_meta($post_id, 'wpcf7s_posted-' . $name, $value);
  21. +                    if (empty($value)) {
  22. +                        $value = '';
  23.                      }
  24. +                    add_post_meta($post_id, 'wpcf7s_posted-' . $name, $value);
  25.                  }
  26.              }
  27.  
  28. --
  29. 2.7.4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement