Custom Field Template - Version 0.5.2

Version Description

Download this release

Release Info

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

Code changes from version 0.5.1 to 0.5.2

Files changed (2) hide show
  1. custom-field-template.php +10 -10
  2. readme.txt +1 -1
custom-field-template.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Custom Field Template
4
  Plugin URI: http://wordpressgogo.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: 0.5.1
8
  Author URI: http://wordpressgogo.com/
9
  */
10
 
@@ -383,7 +383,7 @@ jQuery(this).addClass("closed");
383
  '<dt><span' . $hide . '>' . $title . '</span></dt>' .
384
  '<dd>';
385
 
386
- if ( !empty($label) ) $out .= '<p class="label">' . $label . '</p>';
387
  $out .= '<input id="' . $name . '" name="' . $name . '[]" value="' . attribute_escape($value) . '" type="textfield" size="' . $size . '" /></dd>' .
388
  '</dl>';
389
  return $out;
@@ -412,7 +412,7 @@ jQuery(this).addClass("closed");
412
  '<dt><span' . $hide . '>' . $title . '</span></dt>' .
413
  '<dd>';
414
 
415
- if ( !empty($label) ) $out .= '<p class="label">' . $label . '</p>';
416
  $out .= '<label for="' . $id . '" class="selectit"><input name="' . $name . '[' . $sid . ']" value="' . attribute_escape($value) . '" ' . $checked . ' type="checkbox" /> ' . stripcslashes($value) . '</label><br />';
417
 
418
  $out .= '</dd></dl>';
@@ -448,7 +448,7 @@ jQuery(this).addClass("closed");
448
  '</dt>' .
449
  '<dd>';
450
 
451
- if ( !empty($label) ) $out .= '<p class="label">' . $label . '</p>';
452
  foreach( $values as $val ) {
453
  $id = $name . '_' . $this->sanitize_name( $val );
454
 
@@ -483,7 +483,7 @@ jQuery(this).addClass("closed");
483
  '<dt><span' . $hide . '>' . $title . '</span></dt>' .
484
  '<dd>';
485
 
486
- if ( !empty($label) ) $out .= '<p class="label">' . $label . '</p>';
487
  $out .= '<select name="' . $name . '[]">' .
488
  '<option value="" >Select</option>';
489
 
@@ -554,7 +554,7 @@ EOF;
554
  '<dt><span' . $hide . '>' . $title . '</span><br />' . $media . $switch . '</dt>' .
555
  '<dd>';
556
 
557
- if ( !empty($label) ) $out .= '<p class="label">' . $label . '</p>';
558
  $out .= '<textarea id="' . $name . $rand . '" name="' . $name . '[' . $sid . ']" type="textfield" rows="' .$rows. '" cols="' . $cols . '" style="color:#000000">' . attribute_escape($value) . '</textarea><input type="hidden" name="'.$name.'_rand['.$sid.']" value="'.$rand.'" /></dd>' .
559
  '</dl>';
560
  return $out;
@@ -766,16 +766,16 @@ jQuery("#edButtonPreview").trigger("click"); }' . "\n";
766
 
767
  foreach( $fields as $title => $data) {
768
  $name = $this->sanitize_name( $title );
769
- $title = $wpdb->escape(stripslashes(trim($title)));
770
  delete_post_meta($id, $title);
771
  }
772
 
773
  foreach( $fields as $title => $data) {
774
  for($i = 0; $i<count($data); $i++) {
775
  $name = $this->sanitize_name( $title );
776
- $title = $wpdb->escape(stripslashes(trim($title)));
777
 
778
- $meta_value = stripslashes(trim($_REQUEST[ "$name" ][$i]));
779
  if( isset( $meta_value ) && !empty( $meta_value ) ) {
780
  add_post_meta( $id, $title, $meta_value );
781
 
@@ -824,7 +824,7 @@ jQuery("#edButtonPreview").trigger("click"); }' . "\n";
824
  }
825
  $Value = array();
826
  $Value["NAME"] = trim(substr($Temp,0,$Pos));
827
- $Value["VALUE"] = trim(substr($Temp,$Pos+1),' "');
828
 
829
  if ($ProcessSections) {
830
  $Data[$Section][$id][$Value["NAME"]] = $Value["VALUE"];
4
  Plugin URI: http://wordpressgogo.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: 0.5.2
8
  Author URI: http://wordpressgogo.com/
9
  */
10
 
383
  '<dt><span' . $hide . '>' . $title . '</span></dt>' .
384
  '<dd>';
385
 
386
+ if ( !empty($label) ) $out .= '<p class="label">' . stripcslashes($label) . '</p>';
387
  $out .= '<input id="' . $name . '" name="' . $name . '[]" value="' . attribute_escape($value) . '" type="textfield" size="' . $size . '" /></dd>' .
388
  '</dl>';
389
  return $out;
412
  '<dt><span' . $hide . '>' . $title . '</span></dt>' .
413
  '<dd>';
414
 
415
+ if ( !empty($label) ) $out .= '<p class="label">' . stripcslashes($label) . '</p>';
416
  $out .= '<label for="' . $id . '" class="selectit"><input name="' . $name . '[' . $sid . ']" value="' . attribute_escape($value) . '" ' . $checked . ' type="checkbox" /> ' . stripcslashes($value) . '</label><br />';
417
 
418
  $out .= '</dd></dl>';
448
  '</dt>' .
449
  '<dd>';
450
 
451
+ if ( !empty($label) ) $out .= '<p class="label">' . stripcslashes($label) . '</p>';
452
  foreach( $values as $val ) {
453
  $id = $name . '_' . $this->sanitize_name( $val );
454
 
483
  '<dt><span' . $hide . '>' . $title . '</span></dt>' .
484
  '<dd>';
485
 
486
+ if ( !empty($label) ) $out .= '<p class="label">' . stripcslashes($label) . '</p>';
487
  $out .= '<select name="' . $name . '[]">' .
488
  '<option value="" >Select</option>';
489
 
554
  '<dt><span' . $hide . '>' . $title . '</span><br />' . $media . $switch . '</dt>' .
555
  '<dd>';
556
 
557
+ if ( !empty($label) ) $out .= '<p class="label">' . stripcslashes($label) . '</p>';
558
  $out .= '<textarea id="' . $name . $rand . '" name="' . $name . '[' . $sid . ']" type="textfield" rows="' .$rows. '" cols="' . $cols . '" style="color:#000000">' . attribute_escape($value) . '</textarea><input type="hidden" name="'.$name.'_rand['.$sid.']" value="'.$rand.'" /></dd>' .
559
  '</dl>';
560
  return $out;
766
 
767
  foreach( $fields as $title => $data) {
768
  $name = $this->sanitize_name( $title );
769
+ $title = $wpdb->escape(stripcslashes(trim($title)));
770
  delete_post_meta($id, $title);
771
  }
772
 
773
  foreach( $fields as $title => $data) {
774
  for($i = 0; $i<count($data); $i++) {
775
  $name = $this->sanitize_name( $title );
776
+ $title = $wpdb->escape(stripcslashes(trim($title)));
777
 
778
+ $meta_value = stripcslashes(trim($_REQUEST[ "$name" ][$i]));
779
  if( isset( $meta_value ) && !empty( $meta_value ) ) {
780
  add_post_meta( $id, $title, $meta_value );
781
 
824
  }
825
  $Value = array();
826
  $Value["NAME"] = trim(substr($Temp,0,$Pos));
827
+ $Value["VALUE"] = trim(substr($Temp,$Pos+1));
828
 
829
  if ($ProcessSections) {
830
  $Data[$Section][$id][$Value["NAME"]] = $Value["VALUE"];
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://wordpressgogo.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.7 beta 1
7
- Stable tag: 0.5.1
8
 
9
  This plugin adds the default custom fields on the Write Post/Page.
10
 
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.7 beta 1
7
+ Stable tag: 0.5.2
8
 
9
  This plugin adds the default custom fields on the Write Post/Page.
10