Version Description
- Bugfix : Fixed a bug that automatic linefeed affects markup of radio and checkbox.
Download this release
Release Info
Developer | inc2734 |
Plugin | MW WP Form |
Version | 2.14.1 |
Comparing to | |
See all releases |
Code changes from version 2.14.0 to 2.14.1
- classes/models/class.form.php +46 -34
- mw-wp-form.php +2 -2
- readme.txt +4 -1
classes/models/class.form.php
CHANGED
@@ -2,11 +2,11 @@
|
|
2 |
/**
|
3 |
* Name : MW WP Form Form
|
4 |
* Description: フォームヘルパー
|
5 |
-
* Version : 1.10.
|
6 |
* Author : Takashi Kitajima
|
7 |
* Author URI : http://2inc.org
|
8 |
* Created : September 25, 2012
|
9 |
-
* Modified : January
|
10 |
* License : GPLv2 or later
|
11 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
*/
|
@@ -227,11 +227,11 @@ class MW_WP_Form_Form {
|
|
227 |
$options = array_merge( $defaults, $options );
|
228 |
$attributes = $this->generate_attributes( $options );
|
229 |
|
230 |
-
return sprintf(
|
231 |
'<input type="text" name="%s"%s />',
|
232 |
esc_attr( $name ),
|
233 |
$attributes
|
234 |
-
);
|
235 |
}
|
236 |
|
237 |
/**
|
@@ -254,11 +254,11 @@ class MW_WP_Form_Form {
|
|
254 |
$options = array_merge( $defaults, $options );
|
255 |
$attributes = $this->generate_attributes( $options );
|
256 |
|
257 |
-
return sprintf(
|
258 |
'<input type="email" name="%s"%s />',
|
259 |
esc_attr( $name ),
|
260 |
$attributes
|
261 |
-
);
|
262 |
}
|
263 |
|
264 |
/**
|
@@ -281,11 +281,11 @@ class MW_WP_Form_Form {
|
|
281 |
$options = array_merge( $defaults, $options );
|
282 |
$attributes = $this->generate_attributes( $options );
|
283 |
|
284 |
-
return sprintf(
|
285 |
'<input type="url" name="%s"%s />',
|
286 |
esc_attr( $name ),
|
287 |
$attributes
|
288 |
-
);
|
289 |
}
|
290 |
|
291 |
/**
|
@@ -307,11 +307,11 @@ class MW_WP_Form_Form {
|
|
307 |
$options = array_merge( $defaults, $options );
|
308 |
$attributes = $this->generate_attributes( $options );
|
309 |
|
310 |
-
return sprintf(
|
311 |
'<input type="range" name="%s"%s />',
|
312 |
esc_attr( $name ),
|
313 |
$attributes
|
314 |
-
);
|
315 |
}
|
316 |
|
317 |
/**
|
@@ -334,11 +334,11 @@ class MW_WP_Form_Form {
|
|
334 |
$options = array_merge( $defaults, $options );
|
335 |
$attributes = $this->generate_attributes( $options );
|
336 |
|
337 |
-
return sprintf(
|
338 |
'<input type="number" name="%s"%s />',
|
339 |
esc_attr( $name ),
|
340 |
$attributes
|
341 |
-
);
|
342 |
}
|
343 |
|
344 |
/**
|
@@ -349,11 +349,11 @@ class MW_WP_Form_Form {
|
|
349 |
* @return string HTML
|
350 |
*/
|
351 |
public function hidden( $name, $value ) {
|
352 |
-
return sprintf(
|
353 |
'<input type="hidden" name="%s" value="%s" />',
|
354 |
esc_attr( $name ),
|
355 |
esc_attr( $value )
|
356 |
-
);
|
357 |
}
|
358 |
|
359 |
/**
|
@@ -375,11 +375,11 @@ class MW_WP_Form_Form {
|
|
375 |
$options = array_merge( $defaults, $options );
|
376 |
$attributes = $this->generate_attributes( $options );
|
377 |
|
378 |
-
return sprintf(
|
379 |
'<input type="password" name="%s"%s />',
|
380 |
esc_attr( $name ),
|
381 |
$attributes
|
382 |
-
);
|
383 |
}
|
384 |
|
385 |
/**
|
@@ -432,7 +432,7 @@ class MW_WP_Form_Form {
|
|
432 |
) );
|
433 |
$_ret .= $this->separator( $name, $separator );
|
434 |
$_ret .= '</span>';
|
435 |
-
return $_ret;
|
436 |
}
|
437 |
|
438 |
/**
|
@@ -492,7 +492,7 @@ class MW_WP_Form_Form {
|
|
492 |
) );
|
493 |
$_ret .= $this->separator( $name, $separator );
|
494 |
$_ret .= '</span>';
|
495 |
-
return $_ret;
|
496 |
}
|
497 |
|
498 |
/**
|
@@ -516,12 +516,12 @@ class MW_WP_Form_Form {
|
|
516 |
unset( $_options['value'] );
|
517 |
$attributes = $this->generate_attributes( $_options );
|
518 |
|
519 |
-
return sprintf(
|
520 |
'<textarea name="%s"%s>%s</textarea>',
|
521 |
esc_attr( $name ),
|
522 |
$attributes,
|
523 |
esc_html( $options['value'] )
|
524 |
-
);
|
525 |
}
|
526 |
|
527 |
/**
|
@@ -558,7 +558,7 @@ class MW_WP_Form_Form {
|
|
558 |
);
|
559 |
}
|
560 |
$_ret .= '</select>';
|
561 |
-
return $_ret;
|
562 |
}
|
563 |
|
564 |
/**
|
@@ -606,7 +606,7 @@ class MW_WP_Form_Form {
|
|
606 |
esc_html( $_value )
|
607 |
);
|
608 |
}
|
609 |
-
return $_ret;
|
610 |
}
|
611 |
|
612 |
/**
|
@@ -661,7 +661,7 @@ class MW_WP_Form_Form {
|
|
661 |
);
|
662 |
}
|
663 |
$_ret .= $this->separator( $name, $separator );
|
664 |
-
return $_ret;
|
665 |
}
|
666 |
|
667 |
/**
|
@@ -678,12 +678,12 @@ class MW_WP_Form_Form {
|
|
678 |
);
|
679 |
$options = array_merge( $defaults, $options );
|
680 |
$attributes = $this->generate_attributes( $options );
|
681 |
-
return sprintf(
|
682 |
'<input type="submit" name="%s" value="%s"%s />',
|
683 |
esc_attr( $name ),
|
684 |
esc_attr( $value ),
|
685 |
$attributes
|
686 |
-
);
|
687 |
}
|
688 |
|
689 |
/**
|
@@ -701,13 +701,13 @@ class MW_WP_Form_Form {
|
|
701 |
);
|
702 |
$options = array_merge( $defaults, $options );
|
703 |
$attributes = $this->generate_attributes( $options );
|
704 |
-
return sprintf(
|
705 |
'<button type="submit" name="%1$s" value="%2$s"%3$s>%4$s</button>',
|
706 |
esc_attr( $name ),
|
707 |
esc_attr( $value ),
|
708 |
$attributes,
|
709 |
wp_kses_post( $element_content )
|
710 |
-
);
|
711 |
}
|
712 |
|
713 |
/**
|
@@ -724,12 +724,12 @@ class MW_WP_Form_Form {
|
|
724 |
);
|
725 |
$options = array_merge( $defaults, $options );
|
726 |
$attributes = $this->generate_attributes( $options );
|
727 |
-
return sprintf(
|
728 |
'<input type="button" name="%s" value="%s"%s />',
|
729 |
esc_attr( $name ),
|
730 |
esc_attr( $value ),
|
731 |
$attributes
|
732 |
-
);
|
733 |
}
|
734 |
|
735 |
/**
|
@@ -747,13 +747,13 @@ class MW_WP_Form_Form {
|
|
747 |
);
|
748 |
$options = array_merge( $defaults, $options );
|
749 |
$attributes = $this->generate_attributes( $options );
|
750 |
-
return sprintf(
|
751 |
'<button type="button" name="%1$s" value="%2$s"%3$s>%4$s</button>',
|
752 |
esc_attr( $name ),
|
753 |
esc_attr( $value ),
|
754 |
$attributes,
|
755 |
wp_kses_post( $element_content )
|
756 |
-
);
|
757 |
}
|
758 |
|
759 |
/**
|
@@ -787,7 +787,7 @@ class MW_WP_Form_Form {
|
|
787 |
esc_js( $name ),
|
788 |
trim( $options['js'], '{}' )
|
789 |
);
|
790 |
-
return $_ret;
|
791 |
}
|
792 |
|
793 |
/**
|
@@ -805,11 +805,11 @@ class MW_WP_Form_Form {
|
|
805 |
$options = array_merge( $defaults, $options );
|
806 |
$attributes = $this->generate_attributes( $options );
|
807 |
|
808 |
-
return sprintf(
|
809 |
'<input type="file" name="%1$s"%2$s /><span data-mwform-file-delete="%1$s" class="mwform-file-delete">×</span>',
|
810 |
esc_attr( $name ),
|
811 |
$attributes
|
812 |
-
);
|
813 |
}
|
814 |
|
815 |
/**
|
@@ -850,4 +850,16 @@ class MW_WP_Form_Form {
|
|
850 |
return $id;
|
851 |
}
|
852 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
853 |
}
|
2 |
/**
|
3 |
* Name : MW WP Form Form
|
4 |
* Description: フォームヘルパー
|
5 |
+
* Version : 1.10.1
|
6 |
* Author : Takashi Kitajima
|
7 |
* Author URI : http://2inc.org
|
8 |
* Created : September 25, 2012
|
9 |
+
* Modified : January 14, 2017
|
10 |
* License : GPLv2 or later
|
11 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
*/
|
227 |
$options = array_merge( $defaults, $options );
|
228 |
$attributes = $this->generate_attributes( $options );
|
229 |
|
230 |
+
return self::remove_linefeed_space( sprintf(
|
231 |
'<input type="text" name="%s"%s />',
|
232 |
esc_attr( $name ),
|
233 |
$attributes
|
234 |
+
) );
|
235 |
}
|
236 |
|
237 |
/**
|
254 |
$options = array_merge( $defaults, $options );
|
255 |
$attributes = $this->generate_attributes( $options );
|
256 |
|
257 |
+
return self::remove_linefeed_space( sprintf(
|
258 |
'<input type="email" name="%s"%s />',
|
259 |
esc_attr( $name ),
|
260 |
$attributes
|
261 |
+
) );
|
262 |
}
|
263 |
|
264 |
/**
|
281 |
$options = array_merge( $defaults, $options );
|
282 |
$attributes = $this->generate_attributes( $options );
|
283 |
|
284 |
+
return self::remove_linefeed_space( sprintf(
|
285 |
'<input type="url" name="%s"%s />',
|
286 |
esc_attr( $name ),
|
287 |
$attributes
|
288 |
+
) );
|
289 |
}
|
290 |
|
291 |
/**
|
307 |
$options = array_merge( $defaults, $options );
|
308 |
$attributes = $this->generate_attributes( $options );
|
309 |
|
310 |
+
return self::remove_linefeed_space( sprintf(
|
311 |
'<input type="range" name="%s"%s />',
|
312 |
esc_attr( $name ),
|
313 |
$attributes
|
314 |
+
) );
|
315 |
}
|
316 |
|
317 |
/**
|
334 |
$options = array_merge( $defaults, $options );
|
335 |
$attributes = $this->generate_attributes( $options );
|
336 |
|
337 |
+
return self::remove_linefeed_space( sprintf(
|
338 |
'<input type="number" name="%s"%s />',
|
339 |
esc_attr( $name ),
|
340 |
$attributes
|
341 |
+
) );
|
342 |
}
|
343 |
|
344 |
/**
|
349 |
* @return string HTML
|
350 |
*/
|
351 |
public function hidden( $name, $value ) {
|
352 |
+
return self::remove_linefeed_space( sprintf(
|
353 |
'<input type="hidden" name="%s" value="%s" />',
|
354 |
esc_attr( $name ),
|
355 |
esc_attr( $value )
|
356 |
+
) );
|
357 |
}
|
358 |
|
359 |
/**
|
375 |
$options = array_merge( $defaults, $options );
|
376 |
$attributes = $this->generate_attributes( $options );
|
377 |
|
378 |
+
return self::remove_linefeed_space( sprintf(
|
379 |
'<input type="password" name="%s"%s />',
|
380 |
esc_attr( $name ),
|
381 |
$attributes
|
382 |
+
) );
|
383 |
}
|
384 |
|
385 |
/**
|
432 |
) );
|
433 |
$_ret .= $this->separator( $name, $separator );
|
434 |
$_ret .= '</span>';
|
435 |
+
return self::remove_linefeed_space( $_ret );
|
436 |
}
|
437 |
|
438 |
/**
|
492 |
) );
|
493 |
$_ret .= $this->separator( $name, $separator );
|
494 |
$_ret .= '</span>';
|
495 |
+
return self::remove_linefeed_space( $_ret );
|
496 |
}
|
497 |
|
498 |
/**
|
516 |
unset( $_options['value'] );
|
517 |
$attributes = $this->generate_attributes( $_options );
|
518 |
|
519 |
+
return self::remove_linefeed_space( sprintf(
|
520 |
'<textarea name="%s"%s>%s</textarea>',
|
521 |
esc_attr( $name ),
|
522 |
$attributes,
|
523 |
esc_html( $options['value'] )
|
524 |
+
) );
|
525 |
}
|
526 |
|
527 |
/**
|
558 |
);
|
559 |
}
|
560 |
$_ret .= '</select>';
|
561 |
+
return self::remove_linefeed_space( $_ret );
|
562 |
}
|
563 |
|
564 |
/**
|
606 |
esc_html( $_value )
|
607 |
);
|
608 |
}
|
609 |
+
return self::remove_linefeed_space( $_ret );
|
610 |
}
|
611 |
|
612 |
/**
|
661 |
);
|
662 |
}
|
663 |
$_ret .= $this->separator( $name, $separator );
|
664 |
+
return self::remove_linefeed_space( $_ret );
|
665 |
}
|
666 |
|
667 |
/**
|
678 |
);
|
679 |
$options = array_merge( $defaults, $options );
|
680 |
$attributes = $this->generate_attributes( $options );
|
681 |
+
return self::remove_linefeed_space( sprintf(
|
682 |
'<input type="submit" name="%s" value="%s"%s />',
|
683 |
esc_attr( $name ),
|
684 |
esc_attr( $value ),
|
685 |
$attributes
|
686 |
+
) );
|
687 |
}
|
688 |
|
689 |
/**
|
701 |
);
|
702 |
$options = array_merge( $defaults, $options );
|
703 |
$attributes = $this->generate_attributes( $options );
|
704 |
+
return self::remove_linefeed_space( sprintf(
|
705 |
'<button type="submit" name="%1$s" value="%2$s"%3$s>%4$s</button>',
|
706 |
esc_attr( $name ),
|
707 |
esc_attr( $value ),
|
708 |
$attributes,
|
709 |
wp_kses_post( $element_content )
|
710 |
+
) );
|
711 |
}
|
712 |
|
713 |
/**
|
724 |
);
|
725 |
$options = array_merge( $defaults, $options );
|
726 |
$attributes = $this->generate_attributes( $options );
|
727 |
+
return self::remove_linefeed_space( sprintf(
|
728 |
'<input type="button" name="%s" value="%s"%s />',
|
729 |
esc_attr( $name ),
|
730 |
esc_attr( $value ),
|
731 |
$attributes
|
732 |
+
) );
|
733 |
}
|
734 |
|
735 |
/**
|
747 |
);
|
748 |
$options = array_merge( $defaults, $options );
|
749 |
$attributes = $this->generate_attributes( $options );
|
750 |
+
return self::remove_linefeed_space( sprintf(
|
751 |
'<button type="button" name="%1$s" value="%2$s"%3$s>%4$s</button>',
|
752 |
esc_attr( $name ),
|
753 |
esc_attr( $value ),
|
754 |
$attributes,
|
755 |
wp_kses_post( $element_content )
|
756 |
+
) );
|
757 |
}
|
758 |
|
759 |
/**
|
787 |
esc_js( $name ),
|
788 |
trim( $options['js'], '{}' )
|
789 |
);
|
790 |
+
return self::remove_linefeed_space( $_ret );
|
791 |
}
|
792 |
|
793 |
/**
|
805 |
$options = array_merge( $defaults, $options );
|
806 |
$attributes = $this->generate_attributes( $options );
|
807 |
|
808 |
+
return self::remove_linefeed_space( sprintf(
|
809 |
'<input type="file" name="%1$s"%2$s /><span data-mwform-file-delete="%1$s" class="mwform-file-delete">×</span>',
|
810 |
esc_attr( $name ),
|
811 |
$attributes
|
812 |
+
) );
|
813 |
}
|
814 |
|
815 |
/**
|
850 |
return $id;
|
851 |
}
|
852 |
}
|
853 |
+
|
854 |
+
/**
|
855 |
+
* Removed linefeed codes, tabs and spaces
|
856 |
+
*
|
857 |
+
* @param string $string
|
858 |
+
* @return string
|
859 |
+
*/
|
860 |
+
public static function remove_linefeed_space( $string ) {
|
861 |
+
$string = preg_replace( '/\s+\/>/', ' />', $string );
|
862 |
+
$string = preg_replace( '/>\s*</ms', '><', $string );
|
863 |
+
return $string;
|
864 |
+
}
|
865 |
}
|
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.14.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created : September 25, 2012
|
10 |
-
* Modified: January
|
11 |
* Text Domain: mw-wp-form
|
12 |
* Domain Path: /languages/
|
13 |
* License: GPLv2 or later
|
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.14.1
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created : September 25, 2012
|
10 |
+
* Modified: January 14, 2017
|
11 |
* Text Domain: mw-wp-form
|
12 |
* Domain Path: /languages/
|
13 |
* License: GPLv2 or later
|
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: 4.0
|
6 |
Tested up to: 4.7.1
|
7 |
-
Stable tag: 2.14.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -80,6 +80,9 @@ Do you have questions or issues with MW WP Form? Use these support channels appr
|
|
80 |
|
81 |
== Changelog ==
|
82 |
|
|
|
|
|
|
|
83 |
= 2.14.0 =
|
84 |
* Changed : Update debug log format.
|
85 |
* Changed : Update checkbox and radio field markup.
|
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: 4.0
|
6 |
Tested up to: 4.7.1
|
7 |
+
Stable tag: 2.14.1
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
80 |
|
81 |
== Changelog ==
|
82 |
|
83 |
+
= 2.14.1 =
|
84 |
+
* Bugfix : Fixed a bug that automatic linefeed affects markup of radio and checkbox.
|
85 |
+
|
86 |
= 2.14.0 =
|
87 |
* Changed : Update debug log format.
|
88 |
* Changed : Update checkbox and radio field markup.
|