Custom Field Template - Version 1.8.7

Version Description

  • before and after attributes for the radio and textarea types.
  • Bugfix: file type.
Download this release

Release Info

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

Code changes from version 1.8.6 to 1.8.7

Files changed (2) hide show
  1. custom-field-template.php +12 -7
  2. readme.txt +6 -2
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.6
8
  Author URI: http://wpgogo.com/
9
  */
10
 
@@ -1401,10 +1401,10 @@ hideKey = true<br />
1401
  <th>style</th><td>style = color:#FF0000;</td><td>style = color:#FF0000;</td><td>style = color:#FF0000;</td><td>style = color:#FF0000;</td><td>style = color:#FF0000;</td><td>style = color:#FF0000;</td>
1402
  </tr>
1403
  <tr>
1404
- <th>before</th><td>before = abcde</td><td></td><td></td><td>before = abcde</td><td></td><td>before = abcde</td>
1405
  </tr>
1406
  <tr>
1407
- <th>after</th><td>after = abcde</td><td></td><td></td><td>after = abcde</td><td></td><td>after = abcde</td>
1408
  </tr>
1409
  <tr>
1410
  <th>valueCount</th><td>valueCount = true</td><td>valueCount = true</td><td>valueCount = true</td><td>valueCount = true</td><td>valueCount = true</td><td></td>
@@ -1740,6 +1740,9 @@ jQuery(this).addClass("closed");
1740
  if ( !empty($label) && !$options['custom_field_template_replace_keys_by_labels'] )
1741
  $out .= '<p class="label">' . stripcslashes($label) . '</p>';
1742
  $i = 0;
 
 
 
1743
  if ( is_array($values) ) :
1744
  foreach( $values as $val ) {
1745
  $id = $name . '_' . $this->sanitize_name( $val ) . '_' . $sid . '_' . $cftnum;
@@ -1756,7 +1759,7 @@ jQuery(this).addClass("closed");
1756
  $i++;
1757
  }
1758
  endif;
1759
- $out .= '</dd></dl>'."\n";
1760
 
1761
  return $out;
1762
  }
@@ -1956,6 +1959,8 @@ new_id = original_id.replace(/([0-9]+)$/, parseInt(matchval)+1);}if ( tinyMCE.ge
1956
  if ( !empty($label) && !$options['custom_field_template_replace_keys_by_labels'] )
1957
  $out .= '<p class="label">' . stripcslashes($label) . '</p>';
1958
 
 
 
1959
  if ( $htmlEditor == true ) :
1960
  if( $tinyMCE == true ) $quicktags_hide = ' jQuery(\'#qt_' . sha1($name . $rand) . '_qtags\').hide();';
1961
  $out .= '<div class="quicktags"><script type="text/javascript">' . "\n" . '// <![CDATA[' . "\n" . '
@@ -1965,7 +1970,7 @@ new_id = original_id.replace(/([0-9]+)$/, parseInt(matchval)+1);}if ( tinyMCE.ge
1965
 
1966
  $out .= '<div' . $editorcontainer_class . ' id="editorcontainer_' . $name . $rand . '"><textarea id="' . $name . $rand . '" name="' . $name . '[' . $sid . '][]" rows="' .$rows. '" cols="' . $cols . '"' . $content_class . $style . $event_output . '>' . esc_attr(trim($value)) . '</textarea><input type="hidden" name="'.$name.'_rand['.$sid.']" value="'.$rand.'" /></div>';
1967
  if ( $htmlEditor == true ) $out .= '</div>';
1968
- $out .= '</dd></dl>'."\n";
1969
 
1970
  return $out;
1971
  }
@@ -2023,7 +2028,7 @@ new_id = original_id.replace(/([0-9]+)$/, parseInt(matchval)+1);}if ( tinyMCE.ge
2023
  $out .= '<p class="label">' . stripcslashes($label) . '</p>';
2024
  $out .= trim($before).'<input id="' . $name . $sid . '_' . $cftnum . '" name="' . $name . '['.$sid.'][]" type="file" size="' . $size . '"' . $class . $style . ' onchange="if (jQuery(this).val()) { jQuery(\'#cft_save_button\').attr(\'disabled\', true); jQuery(\'#post-preview\').hide(); } else { jQuery(\'#cft_save_button\').attr(\'disabled\', false); jQuery(\'#post-preview\').show(); }" />'.trim($after).$picker;
2025
 
2026
- if ( isset($value) && ( $value = intval($value) ) && $thumb_url = wp_get_attachment_image_src( $value ) ) :
2027
  $thumb_url = $thumb_url[0];
2028
 
2029
  $post = get_post($value);
@@ -2179,7 +2184,7 @@ tmp.find('."'input[type=text],input[type=hidden],input[type=file]'".').val('."''
2179
  $addfield .= '</span>';
2180
  endif;
2181
 
2182
- if ( isset($data['legend']) ) $out .= '<legend>' . stripcslashes(trim($data['legend'])) . $addfield . '</legend>';
2183
  }
2184
  else if( $data['type'] == 'fieldset_close' ) {
2185
  $out .= '</fieldset>';
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.7
8
  Author URI: http://wpgogo.com/
9
  */
10
 
1401
  <th>style</th><td>style = color:#FF0000;</td><td>style = color:#FF0000;</td><td>style = color:#FF0000;</td><td>style = color:#FF0000;</td><td>style = color:#FF0000;</td><td>style = color:#FF0000;</td>
1402
  </tr>
1403
  <tr>
1404
+ <th>before</th><td>before = abcde</td><td></td><td>before = abcde</td><td>before = abcde</td><td>before = abcde</td><td>before = abcde</td>
1405
  </tr>
1406
  <tr>
1407
+ <th>after</th><td>after = abcde</td><td></td><td>after = abcde</td><td>after = abcde</td><td>after = abcde</td><td>after = abcde</td>
1408
  </tr>
1409
  <tr>
1410
  <th>valueCount</th><td>valueCount = true</td><td>valueCount = true</td><td>valueCount = true</td><td>valueCount = true</td><td>valueCount = true</td><td></td>
1740
  if ( !empty($label) && !$options['custom_field_template_replace_keys_by_labels'] )
1741
  $out .= '<p class="label">' . stripcslashes($label) . '</p>';
1742
  $i = 0;
1743
+
1744
+ $out .= trim($before);
1745
+
1746
  if ( is_array($values) ) :
1747
  foreach( $values as $val ) {
1748
  $id = $name . '_' . $this->sanitize_name( $val ) . '_' . $sid . '_' . $cftnum;
1759
  $i++;
1760
  }
1761
  endif;
1762
+ $out .= trim($after).'</dd></dl>'."\n";
1763
 
1764
  return $out;
1765
  }
1959
  if ( !empty($label) && !$options['custom_field_template_replace_keys_by_labels'] )
1960
  $out .= '<p class="label">' . stripcslashes($label) . '</p>';
1961
 
1962
+ $out .= trim($before);
1963
+
1964
  if ( $htmlEditor == true ) :
1965
  if( $tinyMCE == true ) $quicktags_hide = ' jQuery(\'#qt_' . sha1($name . $rand) . '_qtags\').hide();';
1966
  $out .= '<div class="quicktags"><script type="text/javascript">' . "\n" . '// <![CDATA[' . "\n" . '
1970
 
1971
  $out .= '<div' . $editorcontainer_class . ' id="editorcontainer_' . $name . $rand . '"><textarea id="' . $name . $rand . '" name="' . $name . '[' . $sid . '][]" rows="' .$rows. '" cols="' . $cols . '"' . $content_class . $style . $event_output . '>' . esc_attr(trim($value)) . '</textarea><input type="hidden" name="'.$name.'_rand['.$sid.']" value="'.$rand.'" /></div>';
1972
  if ( $htmlEditor == true ) $out .= '</div>';
1973
+ $out .= trim($after).'</dd></dl>'."\n";
1974
 
1975
  return $out;
1976
  }
2028
  $out .= '<p class="label">' . stripcslashes($label) . '</p>';
2029
  $out .= trim($before).'<input id="' . $name . $sid . '_' . $cftnum . '" name="' . $name . '['.$sid.'][]" type="file" size="' . $size . '"' . $class . $style . ' onchange="if (jQuery(this).val()) { jQuery(\'#cft_save_button\').attr(\'disabled\', true); jQuery(\'#post-preview\').hide(); } else { jQuery(\'#cft_save_button\').attr(\'disabled\', false); jQuery(\'#post-preview\').show(); }" />'.trim($after).$picker;
2030
 
2031
+ if ( isset($value) && ( $value = intval($value) ) && $thumb_url = wp_get_attachment_image_src( $value, 'thumbnail', true ) ) :
2032
  $thumb_url = $thumb_url[0];
2033
 
2034
  $post = get_post($value);
2184
  $addfield .= '</span>';
2185
  endif;
2186
 
2187
+ if ( isset($data['legend']) || isset($addfield) ) $out .= '<legend>' . stripcslashes(trim($data['legend'])) . $addfield . '</legend>';
2188
  }
2189
  else if( $data['type'] == 'fieldset_close' ) {
2190
  $out .= '</fieldset>';
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: Hiroaki Miyashita
3
  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.1
7
- Stable tag: 1.8.6
8
 
9
  This plugin adds the default custom fields on the Write Post/Page.
10
 
@@ -104,6 +104,10 @@ See the default template and modify it.
104
 
105
  == Changelog ==
106
 
 
 
 
 
107
  = 1.8.6 =
108
  * Adds the `mediaRemove` attribute in order to prevent from deleting the file registered from the mediaPicker. ex) mediaRemove = true
109
 
3
  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.7
8
 
9
  This plugin adds the default custom fields on the Write Post/Page.
10
 
104
 
105
  == Changelog ==
106
 
107
+ = 1.8.7 =
108
+ * before and after attributes for the radio and textarea types.
109
+ * Bugfix: file type.
110
+
111
  = 1.8.6 =
112
  * Adds the `mediaRemove` attribute in order to prevent from deleting the file registered from the mediaPicker. ex) mediaRemove = true
113