Custom Field Template - Version 1.4.4

Version Description

  • Bugfix: file type.
Download this release

Release Info

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

Code changes from version 1.4.3 to 1.4.4

Files changed (2) hide show
  1. custom-field-template.php +7 -7
  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.4.3
8
  Author URI: http://wpgogo.com/
9
  */
10
 
@@ -1689,9 +1689,8 @@ jQuery(this).addClass("closed");
1689
  }
1690
  if ( empty($ct_value) ) $ct_value = 1;
1691
 
1692
- if ( !get_post($value) ) :
1693
  delete_post_meta($_REQUEST[ 'post' ], $name, $value);
1694
- if ( $sid != 0 ) return false;
1695
  endif;
1696
 
1697
  if ( $hideKey == true ) $hide = ' class="hideKey"';
@@ -1723,12 +1722,12 @@ jQuery(this).addClass("closed");
1723
  $filename = basename($post->guid);
1724
  $title = esc_attr($post->post_title);
1725
 
1726
- $out .= '<p><label for=""><input type="checkbox" name="'.$name . '_delete[' . $sid . '][]" id="'.$name . '_delete' . $sid . '" value="1" />' . __('Delete', 'custom-field-template') . '</label> <img src="'.$thumb_url.'" width="32" height="32" style="vertical-align:middle;" /> ' . $title . ' </p>';
1727
  $out .= '<input type="hidden" name="'.$name . '[' . $sid . '][]" value="' . $value . '" />';
1728
  endif;
1729
 
1730
  $out .= '</dd></dl>'."\n";
1731
-
1732
  return $out;
1733
  }
1734
 
@@ -2258,6 +2257,7 @@ jQuery("#edButtonPreview").trigger("click"); }' . "\n";*/
2258
  foreach( $val2 as $key3 => $val3 ) :
2259
  foreach( $val3 as $key4 => $val4 ) :
2260
  if ( !empty($val['name'][$key3][$key4]) ) :
 
2261
  $tmpfiles[$key][$key3][$key4]['name'] = $val['name'][$key3][$key4];
2262
  $tmpfiles[$key][$key3][$key4]['type'] = $val['type'][$key3][$key4];
2263
  $tmpfiles[$key][$key3][$key4]['tmp_name'] = $val['tmp_name'][$key3][$key4];
@@ -2310,8 +2310,8 @@ jQuery("#edButtonPreview").trigger("click"); }' . "\n";*/
2310
  wp_delete_attachment($value);
2311
  delete_post_meta($id, $title, $value);
2312
  endif;
2313
- if( isset($tmpfiles[$title][$field_key][$data['cftnum']]) ) :
2314
- $_FILES[$title] = $tmpfiles[$title][$field_key][$data['cftnum']];
2315
  if ( $value ) :
2316
  wp_delete_attachment($value);
2317
  delete_post_meta($id, $title, $value);
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.4.4
8
  Author URI: http://wpgogo.com/
9
  */
10
 
1689
  }
1690
  if ( empty($ct_value) ) $ct_value = 1;
1691
 
1692
+ if ( !get_post($value) && $value ) :
1693
  delete_post_meta($_REQUEST[ 'post' ], $name, $value);
 
1694
  endif;
1695
 
1696
  if ( $hideKey == true ) $hide = ' class="hideKey"';
1722
  $filename = basename($post->guid);
1723
  $title = esc_attr($post->post_title);
1724
 
1725
+ $out .= '<p><label for=""><input type="checkbox" name="'.$name . '_delete[' . $sid . '][' . $cftnum . ']" id="'.$name . '_delete' . $sid . '" value="1" />' . __('Delete', 'custom-field-template') . '</label> <img src="'.$thumb_url.'" width="32" height="32" style="vertical-align:middle;" /> ' . $title . ' </p>';
1726
  $out .= '<input type="hidden" name="'.$name . '[' . $sid . '][]" value="' . $value . '" />';
1727
  endif;
1728
 
1729
  $out .= '</dd></dl>'."\n";
1730
+
1731
  return $out;
1732
  }
1733
 
2257
  foreach( $val2 as $key3 => $val3 ) :
2258
  foreach( $val3 as $key4 => $val4 ) :
2259
  if ( !empty($val['name'][$key3][$key4]) ) :
2260
+ $key = $wpdb->escape(stripcslashes(trim($key)));
2261
  $tmpfiles[$key][$key3][$key4]['name'] = $val['name'][$key3][$key4];
2262
  $tmpfiles[$key][$key3][$key4]['type'] = $val['type'][$key3][$key4];
2263
  $tmpfiles[$key][$key3][$key4]['tmp_name'] = $val['tmp_name'][$key3][$key4];
2310
  wp_delete_attachment($value);
2311
  delete_post_meta($id, $title, $value);
2312
  endif;
2313
+ if( isset($tmpfiles[$name][$field_key][$data['cftnum']]) ) :
2314
+ $_FILES[$title] = $tmpfiles[$name][$field_key][$data['cftnum']];
2315
  if ( $value ) :
2316
  wp_delete_attachment($value);
2317
  delete_post_meta($id, $title, $value);
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: 2.8.4
7
- Stable tag: 1.4.3
8
 
9
  This plugin adds the default custom fields on the Write Post/Page.
10
 
@@ -98,6 +98,9 @@ See the default template and modify it.
98
 
99
  == Changelog ==
100
 
 
 
 
101
  = 1.4.3 =
102
  * Bugfix: group add new button, multiple values, and quotation marks.
103
 
4
  Tags: custom, fields, field, template, meta, custom field, custom fields, custom field template
5
  Requires at least: 2.1
6
  Tested up to: 2.8.4
7
+ Stable tag: 1.4.4
8
 
9
  This plugin adds the default custom fields on the Write Post/Page.
10
 
98
 
99
  == Changelog ==
100
 
101
+ = 1.4.4 =
102
+ * Bugfix: file type.
103
+
104
  = 1.4.3 =
105
  * Bugfix: group add new button, multiple values, and quotation marks.
106