MW WP Form - Version 2.4.6

Version Description

  • Changed : The custom_mail_tag filter hook applied to To, CC and BCC.
  • Changed : Full size image is displayed when you click the thumbnail of the attached image in saving contact data list.
Download this release

Release Info

Developer inc2734
Plugin Icon wp plugin MW WP Form
Version 2.4.6
Comparing to
See all releases

Code changes from version 2.4.5 to 2.4.6

classes/functions.php CHANGED
@@ -2,11 +2,11 @@
2
  /**
3
  * Name : MWF Functions
4
  * Description: 関数
5
- * Version : 1.4.2
6
  * Author : Takashi Kitajima
7
  * Author URI : http://2inc.org
8
  * Created : May 29, 2013
9
- * Modified : April 14, 2015
10
  * License : GPLv2
11
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
  */
@@ -360,10 +360,12 @@ class MWF_Functions {
360
  if ( $mimetype ) {
361
  // 画像だったら
362
  if ( in_array( $mimetype, array( 'image/jpeg', 'image/gif', 'image/png', 'image/bmp' ) ) ) {
363
- $src = wp_get_attachment_image_src( $value, 'thumbnail' );
 
364
  return sprintf(
365
- '<img src="%s" alt="" style="width:50px;height:50px" />',
366
- esc_url( $src[0] )
 
367
  );
368
  }
369
  // 画像以外
2
  /**
3
  * Name : MWF Functions
4
  * Description: 関数
5
+ * Version : 1.4.3
6
  * Author : Takashi Kitajima
7
  * Author URI : http://2inc.org
8
  * Created : May 29, 2013
9
+ * Modified : April 23, 2015
10
  * License : GPLv2
11
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
  */
360
  if ( $mimetype ) {
361
  // 画像だったら
362
  if ( in_array( $mimetype, array( 'image/jpeg', 'image/gif', 'image/png', 'image/bmp' ) ) ) {
363
+ $src_thumbnail = wp_get_attachment_image_src( $value, 'thumbnail' );
364
+ $src_full = wp_get_attachment_image_src( $value, 'full' );
365
  return sprintf(
366
+ '<a href="%s" target="_blank"><img src="%s" alt="" style="max-height:50px" /></a>',
367
+ esc_url( $src_full[0] ),
368
+ esc_url( $src_thumbnail[0] )
369
  );
370
  }
371
  // 画像以外
classes/models/class.mail.php CHANGED
@@ -252,15 +252,14 @@ class MW_WP_Form_Mail {
252
  * @param MW_WP_Form_Setting $Setting
253
  */
254
  public function set_reply_mail_raw_params( MW_WP_Form_Setting $Setting ) {
255
- $this->to = '';
256
- $this->cc = '';
257
- $this->bcc = '';
 
258
 
259
  $Data = MW_WP_Form_Data::getInstance();
260
  $automatic_reply_email = $Setting->get( 'automatic_reply_email' );
261
 
262
- // 自動返信メールからは添付ファイルを削除
263
- $this->attachments = array();
264
  $form_id = $Setting->get( 'post_id' );
265
  if ( $form_id ) {
266
  $Validation = new MW_WP_Form_Validation_Rule_Mail();
252
  * @param MW_WP_Form_Setting $Setting
253
  */
254
  public function set_reply_mail_raw_params( MW_WP_Form_Setting $Setting ) {
255
+ $this->to = '';
256
+ $this->cc = '';
257
+ $this->bcc = '';
258
+ $this->attachments = array();
259
 
260
  $Data = MW_WP_Form_Data::getInstance();
261
  $automatic_reply_email = $Setting->get( 'automatic_reply_email' );
262
 
 
 
263
  $form_id = $Setting->get( 'post_id' );
264
  if ( $form_id ) {
265
  $Validation = new MW_WP_Form_Validation_Rule_Mail();
classes/services/class.mail-parser.php CHANGED
@@ -2,11 +2,11 @@
2
  /**
3
  * Name : MW WP Form Mail Parser
4
  * Description: メールパーサー
5
- * Version : 1.0.0
6
  * Author : Takashi Kitajima
7
  * Author URI : http://2inc.org
8
  * Created : April 14, 2015
9
- * Modified :
10
  * License : GPLv2
11
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
  */
@@ -82,9 +82,20 @@ class MW_WP_Form_Mail_Parser {
82
  protected function parse_mail_object( $do_update = false ) {
83
  $parsed_Mail_vars = get_object_vars( $this->Mail );
84
  foreach ( $parsed_Mail_vars as $key => $value ) {
85
- if ( is_array( $value ) || $key == 'to' || $key == 'cc' || $key == 'bcc' ) {
86
  continue;
87
  }
 
 
 
 
 
 
 
 
 
 
 
88
  if ( $key == 'body' && $do_update ) {
89
  $value = $this->parse_mail_content( $value, true );
90
  } else {
@@ -140,16 +151,28 @@ class MW_WP_Form_Mail_Parser {
140
  } else {
141
  $form_key = MWF_Functions::get_form_key_from_form_id( $form_id );
142
  $value = $this->Data->get( $match );
143
- $value = apply_filters(
144
- 'mwform_custom_mail_tag_' . $form_key,
145
- $value,
146
- $match,
147
- $this->insert_contact_data_id
148
- );
149
  }
150
  if ( $value !== null && $do_update ) {
151
  update_post_meta( $this->insert_contact_data_id, $match, $value );
152
  }
153
  return $value;
154
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
155
  }
2
  /**
3
  * Name : MW WP Form Mail Parser
4
  * Description: メールパーサー
5
+ * Version : 1.0.1
6
  * Author : Takashi Kitajima
7
  * Author URI : http://2inc.org
8
  * Created : April 14, 2015
9
+ * Modified : April 22, 2015
10
  * License : GPLv2
11
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
  */
82
  protected function parse_mail_object( $do_update = false ) {
83
  $parsed_Mail_vars = get_object_vars( $this->Mail );
84
  foreach ( $parsed_Mail_vars as $key => $value ) {
85
+ if ( is_array( $value ) ) {
86
  continue;
87
  }
88
+
89
+ if ( $key == 'to' || $key == 'cc' || $key == 'bcc' ) {
90
+ $form_id = $this->Setting->get( 'post_id' );
91
+ $form_key = MWF_Functions::get_form_key_from_form_id( $form_id );
92
+ $value = $this->apply_filters_mwform_custom_mail_tag( $form_key, null, $key );
93
+ if ( !is_null( $value ) ) {
94
+ $this->Mail->$key = $value;
95
+ }
96
+ continue;
97
+ }
98
+
99
  if ( $key == 'body' && $do_update ) {
100
  $value = $this->parse_mail_content( $value, true );
101
  } else {
151
  } else {
152
  $form_key = MWF_Functions::get_form_key_from_form_id( $form_id );
153
  $value = $this->Data->get( $match );
154
+ $value = $this->apply_filters_mwform_custom_mail_tag( $form_key, $value, $match );
 
 
 
 
 
155
  }
156
  if ( $value !== null && $do_update ) {
157
  update_post_meta( $this->insert_contact_data_id, $match, $value );
158
  }
159
  return $value;
160
  }
161
+
162
+ /**
163
+ * フィルターフック mwform_custom_mail_tag を実行
164
+ *
165
+ * @param string $form_key
166
+ * @param string|null $value
167
+ * @param string $match
168
+ * @return string
169
+ */
170
+ protected function apply_filters_mwform_custom_mail_tag( $form_key, $value, $match ) {
171
+ return apply_filters(
172
+ 'mwform_custom_mail_tag_' . $form_key,
173
+ $value,
174
+ $match,
175
+ $this->insert_contact_data_id
176
+ );
177
+ }
178
  }
classes/services/class.mail.php CHANGED
@@ -66,6 +66,7 @@ class MW_WP_Form_Mail_Service {
66
 
67
  if ( $this->Setting->get( 'post_id' ) ) {
68
  $this->set_admin_mail_raw_params();
 
69
  $this->set_attachments( $this->Mail_admin_raw );
70
  $this->Mail_admin_raw = $this->apply_filters_mwform_admin_mail_raw( $this->Mail_admin_raw );
71
 
66
 
67
  if ( $this->Setting->get( 'post_id' ) ) {
68
  $this->set_admin_mail_raw_params();
69
+ // 管理者宛メールにだけ添付ファイルを添付
70
  $this->set_attachments( $this->Mail_admin_raw );
71
  $this->Mail_admin_raw = $this->apply_filters_mwform_admin_mail_raw( $this->Mail_admin_raw );
72
 
mw-wp-form.php CHANGED
@@ -3,11 +3,11 @@
3
  * Plugin Name: MW WP Form
4
  * Plugin URI: http://plugins.2inc.org/mw-wp-form/
5
  * Description: MW WP Form is shortcode base contact form plugin. This plugin have many feature. For example you can use many validation rules, contact data saving, and chart aggregation using saved contact data.
6
- * Version: 2.4.5
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
  * Created : September 25, 2012
10
- * Modified: April 14, 2015
11
  * Text Domain: mw-wp-form
12
  * Domain Path: /languages/
13
  * License: GPLv2
3
  * Plugin Name: MW WP Form
4
  * Plugin URI: http://plugins.2inc.org/mw-wp-form/
5
  * Description: MW WP Form is shortcode base contact form plugin. This plugin have many feature. For example you can use many validation rules, contact data saving, and chart aggregation using saved contact data.
6
+ * Version: 2.4.6
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
  * Created : September 25, 2012
10
+ * Modified: April 22, 2015
11
  * Text Domain: mw-wp-form
12
  * Domain Path: /languages/
13
  * License: GPLv2
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.amazon.co.jp/registry/wishlist/39ANKRNSTNW40
4
  Tags: plugin, form, confirm, preview, shortcode, mail, chart, graph, html, contact form, form creation, form creator, form manager, form builder, custom form
5
  Requires at least: 3.7
6
  Tested up to: 4.1.1
7
- Stable tag: 2.4.5
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -71,6 +71,10 @@ Do you have questions or issues with MW WP Form? Use these support channels appr
71
 
72
  == Changelog ==
73
 
 
 
 
 
74
  = 2.4.5 =
75
  * Refactoring MW_WP_Form_Data Class.
76
  * Added : Add MW_WP_Form_Mail_Parse class.
4
  Tags: plugin, form, confirm, preview, shortcode, mail, chart, graph, html, contact form, form creation, form creator, form manager, form builder, custom form
5
  Requires at least: 3.7
6
  Tested up to: 4.1.1
7
+ Stable tag: 2.4.6
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
71
 
72
  == Changelog ==
73
 
74
+ = 2.4.6 =
75
+ * Changed : The custom_mail_tag filter hook applied to To, CC and BCC.
76
+ * Changed : Full size image is displayed when you click the thumbnail of the attached image in saving contact data list.
77
+
78
  = 2.4.5 =
79
  * Refactoring MW_WP_Form_Data Class.
80
  * Added : Add MW_WP_Form_Mail_Parse class.