Contact Form Submissions - Version 1.4

Version Description

  • Added columns to the listing page to show all form posted values when filtering by a contact form
Download this release

Release Info

Developer jasongreen
Plugin Icon 128x128 Contact Form Submissions
Version 1.4
Comparing to
See all releases

Code changes from version 1.3.3 to 1.4

Files changed (3) hide show
  1. Admin.php +28 -2
  2. contact-form-submissions.php +1 -1
  3. readme.txt +10 -6
Admin.php CHANGED
@@ -17,6 +17,8 @@ class WPCF7SAdmin {
17
  add_filter('views_edit-wpcf7s', array($this, 'views'), 999);
18
 
19
  add_filter('gettext', array($this, 'custom_status'), 20, 3);
 
 
20
  }
21
 
22
  function custom_status($translations, $text, $domain){
@@ -108,10 +110,21 @@ class WPCF7SAdmin {
108
  $columns = array(
109
  'cb' => '<input type="checkbox">',
110
  'submission' => __('Submission', 'contact-form-submissions'),
111
- 'form' => __('Contact Form', 'contact-form-submissions'),
112
- 'date' => __('Date', 'contact-form-submissions')
113
  );
114
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  return $columns;
116
  }
117
 
@@ -137,6 +150,9 @@ class WPCF7SAdmin {
137
  </strong>
138
  <?php
139
  break;
 
 
 
140
  }
141
  }
142
 
@@ -235,4 +251,14 @@ class WPCF7SAdmin {
235
 
236
  return $posted;
237
  }
 
 
 
 
 
 
 
 
 
 
238
  }
17
  add_filter('views_edit-wpcf7s', array($this, 'views'), 999);
18
 
19
  add_filter('gettext', array($this, 'custom_status'), 20, 3);
20
+
21
+ add_filter('manage_wpcf7s_posts_columns', array($this, 'admin_table_columns'));
22
  }
23
 
24
  function custom_status($translations, $text, $domain){
110
  $columns = array(
111
  'cb' => '<input type="checkbox">',
112
  'submission' => __('Submission', 'contact-form-submissions'),
113
+ 'form' => __('Contact Form', 'contact-form-submissions')
 
114
  );
115
 
116
+ if(isset($_GET['wpcf7_contact_form']) && !empty($_GET['wpcf7_contact_form'])){
117
+ $form_id = $_GET['wpcf7_contact_form'];
118
+
119
+ $wpcf7s_columns = $this->get_available_columns($form_id);
120
+
121
+ foreach($wpcf7s_columns as $meta_key){
122
+ $columns[$meta_key] = str_replace('wpcf7s_posted-', '', $meta_key);
123
+ }
124
+ }
125
+
126
+ $columns['date'] = __('Date', 'contact-form-submissions');
127
+
128
  return $columns;
129
  }
130
 
150
  </strong>
151
  <?php
152
  break;
153
+ default :
154
+ echo get_post_meta($post_id, $column, true);
155
+ break;
156
  }
157
  }
158
 
251
 
252
  return $posted;
253
  }
254
+
255
+ function get_available_columns($form_id = 0){
256
+ global $wpdb;
257
+
258
+ $post_id = $wpdb->get_var("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = 'form_id' AND meta_value = $form_id LIMIT 1;");
259
+
260
+ $columns = $wpdb->get_col("SELECT meta_key FROM wp_postmeta WHERE post_id = $post_id AND meta_key LIKE '%wpcf7s_%' GROUP BY meta_key");
261
+
262
+ return $columns;
263
+ }
264
  }
contact-form-submissions.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Contact Form Submissions
4
  Description: Never miss an enquiry again! Save all Contact Form 7 submissions in your database.
5
- Version: 1.3.3
6
  Author: Jason Green
7
  License: GPLv3
8
  Domain Path: /languages
2
  /*
3
  Plugin Name: Contact Form Submissions
4
  Description: Never miss an enquiry again! Save all Contact Form 7 submissions in your database.
5
+ Version: 1.4
6
  Author: Jason Green
7
  License: GPLv3
8
  Domain Path: /languages
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: jasongreen
3
  Tags: contact form 7, save contact form, submissions, contact form db, cf7, wpcf7, contact form storage, contact form seven, contact form 7 db
4
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=SNHXWSXSPYATE
5
  Requires at least: 3.0.1
6
- Tested up to: 4.5.1
7
- Stable tag: 1.3.3
8
  License: GPLv3
9
 
10
  Never miss an enquiry again! Save all Contact Form 7 submissions safely in your database.
@@ -13,11 +13,11 @@ Never miss an enquiry again! Save all Contact Form 7 submissions safely in your
13
 
14
  Easy install, no configuration necessary. Once activated all contact form 7 submissions will be saved so you can view them in wp-admin.
15
 
16
- Each submission is stored so they can be easily managed using the default WordPress interface. You can filter subsmissions by searching for keywords, selecting individual contact forms or picking a date range.
17
 
18
- All submissions can be exported using the default WordPress exporter.
19
 
20
- This plugin has no ads or donation links so you can use this on all your sites.
21
 
22
  == Installation ==
23
 
@@ -33,10 +33,14 @@ None yet
33
  == Screenshots ==
34
 
35
  1. Submissions overview screen
36
- 2. Submission detailed screen
 
37
 
38
  == Changelog ==
39
 
 
 
 
40
  = 1.3.2 =
41
  * Minor bug fix
42
 
3
  Tags: contact form 7, save contact form, submissions, contact form db, cf7, wpcf7, contact form storage, contact form seven, contact form 7 db
4
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=SNHXWSXSPYATE
5
  Requires at least: 3.0.1
6
+ Tested up to: 4.5.2
7
+ Stable tag: 1.4
8
  License: GPLv3
9
 
10
  Never miss an enquiry again! Save all Contact Form 7 submissions safely in your database.
13
 
14
  Easy install, no configuration necessary. Once activated all contact form 7 submissions will be saved so you can view them in wp-admin.
15
 
16
+ Each submission is stored in the database so they can be easily managed using the default WordPress interface. You can filter subsmissions by searching for keywords, selecting individual contact forms or picking a date range. To show the posted values in the listing table just filter the submissions by a form.
17
 
18
+ All submissions can be exported using the any WordPress post exporter.
19
 
20
+ This plugin has been made with no ads or donation links so you can use this on all your sites.
21
 
22
  == Installation ==
23
 
33
  == Screenshots ==
34
 
35
  1. Submissions overview screen
36
+ 2. Submissions filtered view
37
+ 3. Submission detailed screen
38
 
39
  == Changelog ==
40
 
41
+ = 1.4 =
42
+ * Added columns to the listing page to show all form posted values when filtering by a contact form
43
+
44
  = 1.3.2 =
45
  * Minor bug fix
46