Custom Field Template - Version 2.1.8

Version Description

  • Bugfix: preview by multiple authors.
Download this release

Release Info

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

Code changes from version 2.1.7 to 2.1.8

Files changed (2) hide show
  1. custom-field-template.php +13 -7
  2. readme.txt +5 -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: 2.1.7
8
  Author URI: http://wpgogo.com/
9
  */
10
 
@@ -2831,6 +2831,7 @@ jQuery("#edButtonPreview").trigger("click"); }' . "\n";*/
2831
  endif;
2832
  }
2833
 
 
2834
  echo $out;
2835
  }
2836
 
@@ -2988,10 +2989,7 @@ jQuery("#edButtonPreview").trigger("click"); }' . "\n";*/
2988
 
2989
  if( isset($_REQUEST['custom-field-template-verify-key']) && !wp_verify_nonce($_REQUEST['custom-field-template-verify-key'], 'custom-field-template') )
2990
  return $id;
2991
-
2992
- if ( $post->post_type == 'revision' )
2993
- return $id;
2994
-
2995
  if ( !empty($_POST['wp-preview']) && $id != $post->ID ) :
2996
  $revision_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'revision'", $id ) );
2997
  $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE post_id IN (" . implode( ',', $revision_ids ) . ")" );
@@ -3014,6 +3012,9 @@ jQuery("#edButtonPreview").trigger("click"); }' . "\n";*/
3014
  $id = $post->ID;
3015
  endif;
3016
 
 
 
 
3017
  if ( !isset($_REQUEST['custom-field-template-id']) ) :
3018
  if ( isset($options['posts'][$id]) ) unset($options['posts'][$id]);
3019
  update_option('custom_field_template_data', $options);
@@ -4021,7 +4022,10 @@ jQuery("#edButtonPreview").trigger("click"); }' . "\n";*/
4021
  function get_preview_postmeta( $return, $post_id, $meta_key, $single ) {
4022
  if ( $preview_id = $this->get_preview_id( $post_id ) ) :
4023
  if ( $post_id != $preview_id ) :
4024
- $return = get_post_meta( $preview_id, $meta_key, $single );
 
 
 
4025
  endif;
4026
  endif;
4027
  return $return;
@@ -4057,7 +4061,9 @@ jQuery("#edButtonPreview").trigger("click"); }' . "\n";*/
4057
  function custom_field_template_delete_post($post_id) {
4058
  global $wpdb;
4059
  $options = $this->get_custom_field_template_data();
4060
- $id = !empty($options['posts'][$post_id]) ? $options['posts'][$post_id] : '';
 
 
4061
 
4062
  if ( is_numeric($id) ) :
4063
  $fields = $this->get_custom_fields($id);
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.8
8
  Author URI: http://wpgogo.com/
9
  */
10
 
2831
  endif;
2832
  }
2833
 
2834
+ $out .= '<div style="clear:both;"></div>';
2835
  echo $out;
2836
  }
2837
 
2989
 
2990
  if( isset($_REQUEST['custom-field-template-verify-key']) && !wp_verify_nonce($_REQUEST['custom-field-template-verify-key'], 'custom-field-template') )
2991
  return $id;
2992
+
 
 
 
2993
  if ( !empty($_POST['wp-preview']) && $id != $post->ID ) :
2994
  $revision_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'revision'", $id ) );
2995
  $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE post_id IN (" . implode( ',', $revision_ids ) . ")" );
3012
  $id = $post->ID;
3013
  endif;
3014
 
3015
+ if ( $post->post_type == 'revision' )
3016
+ return $id;
3017
+
3018
  if ( !isset($_REQUEST['custom-field-template-id']) ) :
3019
  if ( isset($options['posts'][$id]) ) unset($options['posts'][$id]);
3020
  update_option('custom_field_template_data', $options);
4022
  function get_preview_postmeta( $return, $post_id, $meta_key, $single ) {
4023
  if ( $preview_id = $this->get_preview_id( $post_id ) ) :
4024
  if ( $post_id != $preview_id ) :
4025
+ $return = $this->get_post_meta( $preview_id, $meta_key, $single );
4026
+ /*if ( empty($return) && !empty($post_id) ) :
4027
+ $return = $this->get_post_meta( $post_id, $meta_key, $single );
4028
+ endif;*/
4029
  endif;
4030
  endif;
4031
  return $return;
4061
  function custom_field_template_delete_post($post_id) {
4062
  global $wpdb;
4063
  $options = $this->get_custom_field_template_data();
4064
+
4065
+ if ( is_numeric($post_id) )
4066
+ $id = !empty($options['posts'][$post_id]) ? $options['posts'][$post_id] : '';
4067
 
4068
  if ( is_numeric($id) ) :
4069
  $fields = $this->get_custom_fields($id);
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: Hiroaki Miyashita
3
  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.7
8
  License: GPLv2 or later
9
 
10
  The Custom Field Template plugin extends the functionality of custom fields.
@@ -112,6 +112,9 @@ See the default template and modify it.
112
 
113
  == Changelog ==
114
 
 
 
 
115
  = 2.1.7 =
116
  * Code cleaning.
117
 
3
  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.7
7
+ Stable tag: 2.1.8
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.8 =
116
+ * Bugfix: preview by multiple authors.
117
+
118
  = 2.1.7 =
119
  * Code cleaning.
120