MW WP Form - Version 1.7.1

Version Description

  • Bug fix : Fixed a bug that MW WP Form's shortcodes doesn't parse in the nested shortcode.
Download this release

Release Info

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

Code changes from version 1.7.0 to 1.7.1

Files changed (2) hide show
  1. mw-wp-form.php +29 -12
  2. readme.txt +5 -2
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 can create mail form with a confirmation screen.
6
- * Version: 1.7.0
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
  * Created : September 25, 2012
10
- * Modified: April 29, 2014
11
  * Text Domain: mw-wp-form
12
  * Domain Path: /languages/
13
  * License: GPL2
@@ -227,6 +227,28 @@ class mw_wp_form {
227
  wp_enqueue_script( MWF_Config::DOMAIN );
228
  }
229
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
230
  /**
231
  * main
232
  * 表示画面でのプラグインの処理等。
@@ -242,19 +264,14 @@ class mw_wp_form {
242
  add_shortcode( 'mwform_formkey', array( $this, '_meta_mwform_formkey' ) );
243
 
244
  if ( is_singular() && !empty( $post->ID ) ) {
245
- preg_match_all( '/' . get_shortcode_regex() . '/s', $post->post_content, $matches, PREG_SET_ORDER );
246
  }
247
- if ( empty( $matches ) && !( defined( 'MWFORM_NOT_USE_TEMPLATE' ) && MWFORM_NOT_USE_TEMPLATE === true ) ) {
248
  $template_data = @file_get_contents( $template );
249
- preg_match_all( '/' . get_shortcode_regex() . '/s', $template_data, $matches, PREG_SET_ORDER );
250
  }
251
- if ( !empty( $matches ) ) {
252
- foreach ( $matches as $shortcode ) {
253
- if ( in_array( $shortcode[2], array( 'mwform', 'mwform_formkey' ) ) ) {
254
- do_shortcode( $shortcode[0] );
255
- break;
256
- }
257
- }
258
  }
259
  remove_shortcode( 'mwform' );
260
  remove_shortcode( 'mwform_formkey' );
3
  * Plugin Name: MW WP Form
4
  * Plugin URI: http://plugins.2inc.org/mw-wp-form/
5
  * Description: MW WP Form can create mail form with a confirmation screen.
6
+ * Version: 1.7.1
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
  * Created : September 25, 2012
10
+ * Modified: June 30, 2014
11
  * Text Domain: mw-wp-form
12
  * Domain Path: /languages/
13
  * License: GPL2
227
  wp_enqueue_script( MWF_Config::DOMAIN );
228
  }
229
 
230
+ /**
231
+ * get_shortcode
232
+ * MW WP Form のショートコードが含まれていればそのショートコードを返す
233
+ * @param string $content
234
+ * @return string $_shortcode
235
+ */
236
+ private function get_shortcode( $content ) {
237
+ preg_match_all( '/' . get_shortcode_regex() . '/s', $content, $matches, PREG_SET_ORDER );
238
+ if ( $matches ) {
239
+ foreach ( $matches as $shortcode ) {
240
+ if ( in_array( $shortcode[2], array( 'mwform', 'mwform_formkey' ) ) ) {
241
+ return $shortcode;
242
+ } else {
243
+ $_shortcode = $this->get_shortcode( $shortcode[5] );
244
+ if ( $_shortcode ) {
245
+ return $_shortcode;
246
+ }
247
+ }
248
+ }
249
+ }
250
+ }
251
+
252
  /**
253
  * main
254
  * 表示画面でのプラグインの処理等。
264
  add_shortcode( 'mwform_formkey', array( $this, '_meta_mwform_formkey' ) );
265
 
266
  if ( is_singular() && !empty( $post->ID ) ) {
267
+ $shortcode = $this->get_shortcode( $post->post_content );
268
  }
269
+ if ( empty( $shortcode ) && !( defined( 'MWFORM_NOT_USE_TEMPLATE' ) && MWFORM_NOT_USE_TEMPLATE === true ) ) {
270
  $template_data = @file_get_contents( $template );
271
+ $shortcode = $this->get_shortcode( $template_data );
272
  }
273
+ if ( is_array( $shortcode ) && !empty( $shortcode[0] ) ) {
274
+ do_shortcode( $shortcode[0] );
 
 
 
 
 
275
  }
276
  remove_shortcode( 'mwform' );
277
  remove_shortcode( 'mwform_formkey' );
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: inc2734, ryu263
3
  Donate link: http://www.amazon.co.jp/registry/wishlist/39ANKRNSTNW40
4
  Tags: plugin, form, confirm, preview, shortcode, mail
5
  Requires at least: 3.5
6
- Tested up to: 3.9.0
7
- Stable tag: 1.7.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -54,6 +54,9 @@ Do you have questions or issues with MW WP Form? Use these support channels appr
54
 
55
  == Changelog ==
56
 
 
 
 
57
  = 1.7.0 =
58
  * Added : X-Accel-Expires param in header.
59
  * Added : Add CC setting in admin mail setting.
3
  Donate link: http://www.amazon.co.jp/registry/wishlist/39ANKRNSTNW40
4
  Tags: plugin, form, confirm, preview, shortcode, mail
5
  Requires at least: 3.5
6
+ Tested up to: 3.9.1
7
+ Stable tag: 1.7.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
54
 
55
  == Changelog ==
56
 
57
+ = 1.7.1 =
58
+ * Bug fix : Fixed a bug that MW WP Form's shortcodes doesn't parse in the nested shortcode.
59
+
60
  = 1.7.0 =
61
  * Added : X-Accel-Expires param in header.
62
  * Added : Add CC setting in admin mail setting.