Custom Field Template - Version 1.8.9

Version Description

  • Bugfix: saving multiple fields.
Download this release

Release Info

Developer Hiroaki Miyashita
Plugin Icon 128x128 Custom Field Template
Version 1.8.9
Comparing to
See all releases

Code changes from version 1.8.8 to 1.8.9

Files changed (2) hide show
  1. custom-field-template.php +15 -8
  2. readme.txt +4 -1
custom-field-template.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Custom Field Template
4
  Plugin URI: http://wpgogo.com/development/custom-field-template.html
5
  Description: This plugin adds the default custom fields on the Write Post/Page.
6
  Author: Hiroaki Miyashita
7
- Version: 1.8.8
8
  Author URI: http://wpgogo.com/
9
  */
10
 
@@ -1744,7 +1744,7 @@ jQuery(this).addClass("closed");
1744
  $out .= '<p class="label">' . stripcslashes($label) . '</p>';
1745
  $i = 0;
1746
 
1747
- $out .= trim($before);
1748
 
1749
  if ( is_array($values) ) :
1750
  foreach( $values as $val ) {
@@ -2191,7 +2191,11 @@ tmp.find('."'input[type=text],input[type=hidden],input[type=file]'".').val('."''
2191
  $addfield .= '</span>';
2192
  endif;
2193
 
2194
- if ( isset($data['legend']) || isset($addfield) ) $out .= '<legend>' . stripcslashes(trim($data['legend'])) . $addfield . '</legend>';
 
 
 
 
2195
  }
2196
  else if( $data['type'] == 'fieldset_close' ) {
2197
  $out .= '</fieldset>';
@@ -2683,17 +2687,20 @@ jQuery("#edButtonPreview").trigger("click"); }' . "\n";*/
2683
  endforeach;
2684
  endif;
2685
  unset($_FILES);
2686
-
2687
  foreach( $fields as $field_key => $field_val) :
2688
  foreach( $field_val as $title => $data) :
2689
  //if ( is_numeric($data['parentSN']) ) $field_key = $data['parentSN'];
2690
  $name = $this->sanitize_name( $title );
2691
  $title = $wpdb->escape(stripcslashes(trim($title)));
2692
 
2693
- foreach( $_REQUEST[$name] as $tmp_key => $tmp_val ) :
2694
- $field_key = $tmp_key;
2695
- break;
2696
- endforeach;
 
 
 
2697
 
2698
  switch ( $data['type'] ) :
2699
  case 'fieldset_open' :
4
  Plugin URI: http://wpgogo.com/development/custom-field-template.html
5
  Description: This plugin adds the default custom fields on the Write Post/Page.
6
  Author: Hiroaki Miyashita
7
+ Version: 1.8.9
8
  Author URI: http://wpgogo.com/
9
  */
10
 
1744
  $out .= '<p class="label">' . stripcslashes($label) . '</p>';
1745
  $i = 0;
1746
 
1747
+ $out .= trim($before).'<input name="' . $name . '[' . $sid . '][' . $cftnum . ']" value="" type="hidden" />';
1748
 
1749
  if ( is_array($values) ) :
1750
  foreach( $values as $val ) {
2191
  $addfield .= '</span>';
2192
  endif;
2193
 
2194
+ if ( isset($data['legend']) || isset($addfield) ) :
2195
+ if ( !isset($data['legend']) ) $data['legend'] = '';
2196
+ if ( !isset($addfield) ) $addfield = '';
2197
+ $out .= '<legend>' . stripcslashes(trim($data['legend'])) . $addfield . '</legend>';
2198
+ endif;
2199
  }
2200
  else if( $data['type'] == 'fieldset_close' ) {
2201
  $out .= '</fieldset>';
2687
  endforeach;
2688
  endif;
2689
  unset($_FILES);
2690
+
2691
  foreach( $fields as $field_key => $field_val) :
2692
  foreach( $field_val as $title => $data) :
2693
  //if ( is_numeric($data['parentSN']) ) $field_key = $data['parentSN'];
2694
  $name = $this->sanitize_name( $title );
2695
  $title = $wpdb->escape(stripcslashes(trim($title)));
2696
 
2697
+ unset($field_key);
2698
+ if ( isset($_REQUEST[$name]) && is_array($_REQUEST[$name]) ) :
2699
+ foreach( $_REQUEST[$name] as $tmp_key => $tmp_val ) :
2700
+ $field_key = $tmp_key;
2701
+ if ( is_array($tmp_val) ) $_REQUEST[$name][$tmp_key] = array_values($tmp_val);
2702
+ endforeach;
2703
+ endif;
2704
 
2705
  switch ( $data['type'] ) :
2706
  case 'fieldset_open' :
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://wpgogo.com/development/custom-field-template.html
4
  Tags: custom, fields, field, template, meta, custom field, custom fields, custom field template
5
  Requires at least: 2.1
6
  Tested up to: 3.1.2
7
- Stable tag: 1.8.8
8
 
9
  This plugin adds the default custom fields on the Write Post/Page.
10
 
@@ -105,6 +105,9 @@ See the default template and modify it.
105
 
106
  == Changelog ==
107
 
 
 
 
108
  = 1.8.8 =
109
  * Polish (pl_PL) - Difreo
110
  * Bugfix: saving multiple fields.
4
  Tags: custom, fields, field, template, meta, custom field, custom fields, custom field template
5
  Requires at least: 2.1
6
  Tested up to: 3.1.2
7
+ Stable tag: 1.8.9
8
 
9
  This plugin adds the default custom fields on the Write Post/Page.
10
 
105
 
106
  == Changelog ==
107
 
108
+ = 1.8.9 =
109
+ * Bugfix: saving multiple fields.
110
+
111
  = 1.8.8 =
112
  * Polish (pl_PL) - Difreo
113
  * Bugfix: saving multiple fields.