MW WP Form - Version 2.2.3

Version Description

  • Bug fix : Fixed a bug that exec shortcode are not converted when use template.
Download this release

Release Info

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

Code changes from version 2.2.2 to 2.2.3

classes/services/class.exec-shortcode.php CHANGED
@@ -1,12 +1,12 @@
1
  <?php
2
  /**
3
  * Name : MW WP Form Exec Shortcode
4
- * Version : 1.0.1
5
  * Description: ExecShortcode(mwform、mwform_formkey)の存在有無のチェックとそれらの抽象化レイヤー
6
  * Author : Takashi Kitajima
7
  * Author URI : http://2inc.org
8
  * Created : December 31, 2014
9
- * Modified : January 14, 2015
10
  * License : GPLv2
11
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
  */
@@ -46,7 +46,7 @@ class MW_WP_Form_Exec_Shortcode {
46
 
47
  /**
48
  * __construct
49
- * @param WP_Post|null $_post
50
  * @param string $template 使用テンプレートのパス
51
  */
52
  public function __construct( $post, $template ) {
@@ -97,15 +97,25 @@ class MW_WP_Form_Exec_Shortcode {
97
  if ( is_singular() && !empty( $this->post->ID ) ) {
98
  $exec_shortcode = $this->get_in_content( $this->post->post_content );
99
  }
100
- if ( empty( $exec_shortcode ) &&
101
- !( defined( 'MWFORM_NOT_USE_TEMPLATE' ) && MWFORM_NOT_USE_TEMPLATE === true ) ) {
102
- $response = wp_remote_get( $this->template );
103
- if ( !is_wp_error( $response ) && $response['response']['code'] === 200 ) {
104
- $template_data = $response['body'];
 
 
 
 
 
 
 
 
 
 
105
  $exec_shortcode = $this->get_in_content( $template_data );
 
106
  }
107
  }
108
- return $exec_shortcode;
109
  }
110
 
111
  /**
1
  <?php
2
  /**
3
  * Name : MW WP Form Exec Shortcode
4
+ * Version : 1.0.2
5
  * Description: ExecShortcode(mwform、mwform_formkey)の存在有無のチェックとそれらの抽象化レイヤー
6
  * Author : Takashi Kitajima
7
  * Author URI : http://2inc.org
8
  * Created : December 31, 2014
9
+ * Modified : January 18, 2015
10
  * License : GPLv2
11
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
  */
46
 
47
  /**
48
  * __construct
49
+ * @param WP_Post|null $post
50
  * @param string $template 使用テンプレートのパス
51
  */
52
  public function __construct( $post, $template ) {
97
  if ( is_singular() && !empty( $this->post->ID ) ) {
98
  $exec_shortcode = $this->get_in_content( $this->post->post_content );
99
  }
100
+ if ( empty( $exec_shortcode ) ) {
101
+ $exec_shortcode = $this->get_in_template();
102
+ }
103
+ return $exec_shortcode;
104
+ }
105
+
106
+ /**
107
+ * get_in_template
108
+ * テンプレートファイル(絶対パス)に ExecShortcode が含まれていればそのショートコードを返す
109
+ * @return string [hoge xxx="xxx"]
110
+ */
111
+ protected function get_in_template() {
112
+ if ( !( defined( 'MWFORM_NOT_USE_TEMPLATE' ) && MWFORM_NOT_USE_TEMPLATE === true ) ) {
113
+ $template_data = @file_get_contents( $this->template );
114
+ if ( $template_data ) {
115
  $exec_shortcode = $this->get_in_content( $template_data );
116
+ return $exec_shortcode;
117
  }
118
  }
 
119
  }
120
 
121
  /**
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.2.2
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
  * Created : September 25, 2012
10
- * Modified: January 16, 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.2.3
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
  * Created : September 25, 2012
10
+ * Modified: January 18, 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
7
- Stable tag: 2.2.2
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -71,6 +71,9 @@ Do you have questions or issues with MW WP Form? Use these support channels appr
71
 
72
  == Changelog ==
73
 
 
 
 
74
  = 2.2.2 =
75
  * Bug fix : Fixed a tel validation bug.
76
  * Bug fix : Fixed a zip validation bug.
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
7
+ Stable tag: 2.2.3
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
71
 
72
  == Changelog ==
73
 
74
+ = 2.2.3 =
75
+ * Bug fix : Fixed a bug that exec shortcode are not converted when use template.
76
+
77
  = 2.2.2 =
78
  * Bug fix : Fixed a tel validation bug.
79
  * Bug fix : Fixed a zip validation bug.