Smart Custom Fields - Version 1.6.2

Version Description

  • Fixed a bug that sometimes can't get data when there are multiple Smart Custom Fields settings.
Download this release

Release Info

Developer inc2734
Plugin Icon wp plugin Smart Custom Fields
Version 1.6.2
Comparing to
See all releases

Code changes from version 1.6.1 to 1.6.2

classes/models/class.meta.php CHANGED
@@ -1,10 +1,10 @@
1
  <?php
2
  /**
3
  * Smart_Custom_Fields_Meta
4
- * Version : 1.2.0
5
  * Author : inc2734
6
  * Created : March 17, 2015
7
- * Modified : November 12, 2015
8
  * License : GPLv2 or later
9
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
  */
@@ -99,7 +99,7 @@ class Smart_Custom_Fields_Meta {
99
 
100
  /**
101
  * Post ID がリビジョンのものでも良い感じに投稿タイプを取得
102
- *
103
  * @param int $post_id
104
  * @return string
105
  */
@@ -114,7 +114,7 @@ class Smart_Custom_Fields_Meta {
114
  }
115
  return $this->type;
116
  }
117
-
118
  /**
119
  * このメタデータを持つオブジェクトが保存済みかどうか
120
  * 投稿は auto-draft のときは保存されていない(新規投稿中)
@@ -150,10 +150,10 @@ class Smart_Custom_Fields_Meta {
150
  $maybe_4_3_term_meta = true;
151
  }
152
  }
153
-
154
  if ( _get_meta_table( $this->meta_type ) && !$maybe_4_3_term_meta ) {
155
  $meta = get_metadata( $this->meta_type, $this->id, $key, $single );
156
-
157
  if ( $key === SCF_Config::PREFIX . 'repeat-multiple-data' ) {
158
  return $meta;
159
  }
@@ -173,15 +173,14 @@ class Smart_Custom_Fields_Meta {
173
  if ( is_array( $meta ) ) {
174
  foreach ( $settings as $Setting ) {
175
  $fields = $Setting->get_fields();
176
- }
177
- foreach ( $meta as $meta_key => $meta_value ) {
178
- if ( isset( $fields[$meta_key] ) ) {
179
- $metas[$meta_key] = $meta[$meta_key];
180
  }
181
  }
182
  }
183
  }
184
-
185
  if ( isset( $metas ) ) {
186
  return $metas;
187
  }
@@ -300,7 +299,7 @@ class Smart_Custom_Fields_Meta {
300
  if ( !$key ) {
301
  return false;
302
  }
303
-
304
  $option_name = $this->get_option_name();
305
  $option = get_option( $option_name );
306
 
@@ -319,7 +318,7 @@ class Smart_Custom_Fields_Meta {
319
  }
320
  }
321
  }
322
-
323
  /**
324
  * Delete all term meta for less than WordPress 4.3
325
  */
@@ -364,7 +363,7 @@ class Smart_Custom_Fields_Meta {
364
  if ( !isset( $POST[SCF_Config::NAME] ) ) {
365
  return;
366
  }
367
-
368
  $settings = SCF::get_settings( $object );
369
  foreach ( $settings as $Setting ) {
370
  $groups = $Setting->get_groups();
1
  <?php
2
  /**
3
  * Smart_Custom_Fields_Meta
4
+ * Version : 1.2.1
5
  * Author : inc2734
6
  * Created : March 17, 2015
7
+ * Modified : November 21, 2015
8
  * License : GPLv2 or later
9
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
  */
99
 
100
  /**
101
  * Post ID がリビジョンのものでも良い感じに投稿タイプを取得
102
+ *
103
  * @param int $post_id
104
  * @return string
105
  */
114
  }
115
  return $this->type;
116
  }
117
+
118
  /**
119
  * このメタデータを持つオブジェクトが保存済みかどうか
120
  * 投稿は auto-draft のときは保存されていない(新規投稿中)
150
  $maybe_4_3_term_meta = true;
151
  }
152
  }
153
+
154
  if ( _get_meta_table( $this->meta_type ) && !$maybe_4_3_term_meta ) {
155
  $meta = get_metadata( $this->meta_type, $this->id, $key, $single );
156
+
157
  if ( $key === SCF_Config::PREFIX . 'repeat-multiple-data' ) {
158
  return $meta;
159
  }
173
  if ( is_array( $meta ) ) {
174
  foreach ( $settings as $Setting ) {
175
  $fields = $Setting->get_fields();
176
+ foreach ( $meta as $meta_key => $meta_value ) {
177
+ if ( isset( $fields[$meta_key] ) ) {
178
+ $metas[$meta_key] = $meta[$meta_key];
179
+ }
180
  }
181
  }
182
  }
183
  }
 
184
  if ( isset( $metas ) ) {
185
  return $metas;
186
  }
299
  if ( !$key ) {
300
  return false;
301
  }
302
+
303
  $option_name = $this->get_option_name();
304
  $option = get_option( $option_name );
305
 
318
  }
319
  }
320
  }
321
+
322
  /**
323
  * Delete all term meta for less than WordPress 4.3
324
  */
363
  if ( !isset( $POST[SCF_Config::NAME] ) ) {
364
  return;
365
  }
366
+
367
  $settings = SCF::get_settings( $object );
368
  foreach ( $settings as $Setting ) {
369
  $groups = $Setting->get_groups();
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Smart Custom Fields ===
2
- Contributors: inc2734, toro_unit, mimosafa
3
  Donate link: http://www.amazon.co.jp/registry/wishlist/39ANKRNSTNW40
4
  Tags: plugin, custom field, custom, field, meta, meta field, repeat, repeatable
5
  Requires at least: 3.9
6
  Tested up to: 4.4-beta3
7
- Stable tag: 1.6.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -86,6 +86,9 @@ You can send your own language pack to me.
86
 
87
  == Changelog ==
88
 
 
 
 
89
  = 1.6.1 =
90
  * Fixed a bug that custom field settings vanished when saved.
91
 
1
  === Smart Custom Fields ===
2
+ Contributors: inc2734, toro_unit, mimosafa, hideokamoto
3
  Donate link: http://www.amazon.co.jp/registry/wishlist/39ANKRNSTNW40
4
  Tags: plugin, custom field, custom, field, meta, meta field, repeat, repeatable
5
  Requires at least: 3.9
6
  Tested up to: 4.4-beta3
7
+ Stable tag: 1.6.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
86
 
87
  == Changelog ==
88
 
89
+ = 1.6.2 =
90
+ * Fixed a bug that sometimes can't get data when there are multiple Smart Custom Fields settings.
91
+
92
  = 1.6.1 =
93
  * Fixed a bug that custom field settings vanished when saved.
94
 
smart-custom-fields.php CHANGED
@@ -3,11 +3,11 @@
3
  * Plugin name: Smart Custom Fields
4
  * Plugin URI: https://github.com/inc2734/smart-custom-fields/
5
  * Description: Smart Custom Fields is a simple plugin that management custom fields.
6
- * Version: 1.6.1
7
  * Author: inc2734
8
  * Author URI: http://2inc.org
9
  * Created: October 9, 2014
10
- * Modified: Novermber 17, 2015
11
  * Text Domain: smart-custom-fields
12
  * Domain Path: /languages
13
  * License: GPLv2 or later
3
  * Plugin name: Smart Custom Fields
4
  * Plugin URI: https://github.com/inc2734/smart-custom-fields/
5
  * Description: Smart Custom Fields is a simple plugin that management custom fields.
6
+ * Version: 1.6.2
7
  * Author: inc2734
8
  * Author URI: http://2inc.org
9
  * Created: October 9, 2014
10
+ * Modified: Novermber 21, 2015
11
  * Text Domain: smart-custom-fields
12
  * Domain Path: /languages
13
  * License: GPLv2 or later