Custom Field Template - Version 2.1.6

Version Description

  • Bugfix: file type with the multipleButton attribute.
  • Bugfix: save_post duplicate execution.
Download this release

Release Info

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

Code changes from version 2.1.5 to 2.1.6

Files changed (2) hide show
  1. custom-field-template.php +8 -4
  2. readme.txt +5 -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: 2.1.5
8
  Author URI: http://wpgogo.com/
9
  */
10
 
@@ -2348,7 +2348,7 @@ jQuery(this).addClass("closed");
2348
 
2349
  if ( $multipleButton == true && $ct_value == $cftnum ) :
2350
  $addfield .= '<div style="margin-top:-1em;">';
2351
- $addfield .= '<a href="#clear" onclick="jQuery(this).parent().parent().parent().clone().insertAfter(jQuery(this).parent().parent().parent()).find('."'input'".').val('."''".');jQuery(this).parent().css('."'visibility','hidden'".');jQuery(this).parent().prev().css('."'visibility','hidden'".'); return false;">' . __('Add New', 'custom-field-template') . '</a>';
2352
  $addfield .= '</div>';
2353
  endif;
2354
 
@@ -2978,12 +2978,16 @@ jQuery("#edButtonPreview").trigger("click"); }' . "\n";*/
2978
 
2979
  if( !isset( $id ) || isset($_REQUEST['post_ID']) )
2980
  $id = $_REQUEST['post_ID'];
2981
-
2982
  if( !current_user_can('edit_post', $id) )
2983
  return $id;
2984
 
2985
  if( isset($_REQUEST['custom-field-template-verify-key']) && !wp_verify_nonce($_REQUEST['custom-field-template-verify-key'], 'custom-field-template') )
2986
  return $id;
 
 
 
 
2987
  if ( !empty($_POST['wp-preview']) && $id != $post->ID ) :
2988
  $revision_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'revision'", $id ) );
2989
  $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE post_id IN (" . implode( ',', $revision_ids ) . ")" );
@@ -3181,7 +3185,7 @@ jQuery("#edButtonPreview").trigger("click"); }' . "\n";*/
3181
  add_metadata( 'post', $id, $title, apply_filters('cft_'.rawurlencode($title), $val) );
3182
  endif;
3183
  endforeach;
3184
-
3185
  if ( !empty($tags_input) && is_array($tags_input) ) :
3186
  foreach ( $tags_input as $tags_key => $tags_value ) :
3187
  if ( class_exists('SimpleTags') && $tags_key == 'post_tag' ) :
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: 2.1.6
8
  Author URI: http://wpgogo.com/
9
  */
10
 
2348
 
2349
  if ( $multipleButton == true && $ct_value == $cftnum ) :
2350
  $addfield .= '<div style="margin-top:-1em;">';
2351
+ $addfield .= '<a href="#clear" onclick="var tmp = jQuery(this).parent().parent().parent().clone().insertAfter(jQuery(this).parent().parent().parent());if(tmp.find('."'input[type=file]'".').attr('."'id'".').match(/([0-9]+)$/)) { matchval = RegExp.$1; matchval++;tmp.find('."'input[type=file]'".').attr('."'id',".'tmp.find('."'input[type=file]'".').attr('."'id'".').replace(/([0-9]+)$/, matchval));}if(tmp.find('."'input[type=hidden]'".').attr('."'id'".').match(/([0-9]+)_hide$/)) { matchval = RegExp.$1; matchval++;tmp.find('."'input[type=hidden]'".').attr('."'id',".'tmp.find('."'input[type=hidden]'".').attr('."'id'".').replace(/([0-9]+)_hide$/, matchval+'."'_hide'".'));}if(tmp.find('."'input[type=hidden]'".').attr('."'name'".').match(/\[([0-9]+)\]$/)) { matchval = RegExp.$1; matchval++;tmp.find('."'input[type=hidden]'".').attr('."'name',".'tmp.find('."'input[type=hidden]'".').attr('."'name'".').replace(/\[([0-9]+)\]$/, \'[\'+matchval+\']\'));}jQuery(this).parent().css('."'visibility','hidden'".');jQuery(this).parent().prev().css('."'visibility','hidden'".'); return false;">' . __('Add New', 'custom-field-template') . '</a>';
2352
  $addfield .= '</div>';
2353
  endif;
2354
 
2978
 
2979
  if( !isset( $id ) || isset($_REQUEST['post_ID']) )
2980
  $id = $_REQUEST['post_ID'];
2981
+
2982
  if( !current_user_can('edit_post', $id) )
2983
  return $id;
2984
 
2985
  if( isset($_REQUEST['custom-field-template-verify-key']) && !wp_verify_nonce($_REQUEST['custom-field-template-verify-key'], 'custom-field-template') )
2986
  return $id;
2987
+
2988
+ if ( $post->post_type == 'revision' )
2989
+ return $id;
2990
+
2991
  if ( !empty($_POST['wp-preview']) && $id != $post->ID ) :
2992
  $revision_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'revision'", $id ) );
2993
  $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE post_id IN (" . implode( ',', $revision_ids ) . ")" );
3185
  add_metadata( 'post', $id, $title, apply_filters('cft_'.rawurlencode($title), $val) );
3186
  endif;
3187
  endforeach;
3188
+
3189
  if ( !empty($tags_input) && is_array($tags_input) ) :
3190
  foreach ( $tags_input as $tags_key => $tags_value ) :
3191
  if ( class_exists('SimpleTags') && $tags_key == 'post_tag' ) :
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://wpgogo.com/development/custom-field-template.html
4
  Tags: custom field, custom fields, custom, fields, field, template, meta, custom field template, custom post type
5
  Requires at least: 2.1
6
  Tested up to: 3.6
7
- Stable tag: 2.1.5
8
  License: GPLv2 or later
9
 
10
  The Custom Field Template plugin extends the functionality of custom fields.
@@ -112,6 +112,10 @@ See the default template and modify it.
112
 
113
  == Changelog ==
114
 
 
 
 
 
115
  = 2.1.5 =
116
  * Bugfix: values in a multiple fieldset.
117
 
4
  Tags: custom field, custom fields, custom, fields, field, template, meta, custom field template, custom post type
5
  Requires at least: 2.1
6
  Tested up to: 3.6
7
+ Stable tag: 2.1.6
8
  License: GPLv2 or later
9
 
10
  The Custom Field Template plugin extends the functionality of custom fields.
112
 
113
  == Changelog ==
114
 
115
+ = 2.1.6 =
116
+ * Bugfix: file type with the multipleButton attribute.
117
+ * Bugfix: save_post duplicate execution.
118
+
119
  = 2.1.5 =
120
  * Bugfix: values in a multiple fieldset.
121