Version Description
- Fix revision lines duplication (by @hanamura)
- Fixed a bug that relation felds don't work in options page.
Download this release
Release Info
Developer | inc2734 |
Plugin | Smart Custom Fields |
Version | 2.1.1 |
Comparing to | |
See all releases |
Code changes from version 2.1.0 to 2.1.1
- classes/fields/class.field-relation.php +14 -16
- classes/fields/class.field-taxonomy.php +14 -16
- classes/models/class.revisions.php +9 -9
- readme.txt +5 -1
- smart-custom-fields.php +2 -2
classes/fields/class.field-relation.php
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Smart_Custom_Fields_Field_Relation
|
4 |
-
* Version : 1.3.
|
5 |
* Author : inc2734
|
6 |
* Created : October 7, 2014
|
7 |
-
* Modified :
|
8 |
* License : GPLv2 or later
|
9 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
*/
|
@@ -46,20 +46,18 @@ class Smart_Custom_Fields_Field_Relation extends Smart_Custom_Fields_Field_Base
|
|
46 |
* @param string $hook
|
47 |
*/
|
48 |
public function admin_enqueue_scripts( $hook ) {
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
) );
|
62 |
-
}
|
63 |
}
|
64 |
|
65 |
/**
|
1 |
<?php
|
2 |
/**
|
3 |
* Smart_Custom_Fields_Field_Relation
|
4 |
+
* Version : 1.3.2
|
5 |
* Author : inc2734
|
6 |
* Created : October 7, 2014
|
7 |
+
* Modified : June 22, 2016
|
8 |
* License : GPLv2 or later
|
9 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
*/
|
46 |
* @param string $hook
|
47 |
*/
|
48 |
public function admin_enqueue_scripts( $hook ) {
|
49 |
+
wp_enqueue_script(
|
50 |
+
SCF_Config::PREFIX . 'editor-relation-post-types',
|
51 |
+
plugins_url( SCF_Config::NAME ) . '/js/editor-relation-post-types.js',
|
52 |
+
array( 'jquery' ),
|
53 |
+
null,
|
54 |
+
true
|
55 |
+
);
|
56 |
+
wp_localize_script( SCF_Config::PREFIX . 'editor-relation-post-types', 'smart_cf_relation_post_types', array(
|
57 |
+
'endpoint' => admin_url( 'admin-ajax.php' ),
|
58 |
+
'action' => SCF_Config::PREFIX . 'relational-posts-search',
|
59 |
+
'nonce' => wp_create_nonce( SCF_Config::NAME . '-relation-post-types' )
|
60 |
+
) );
|
|
|
|
|
61 |
}
|
62 |
|
63 |
/**
|
classes/fields/class.field-taxonomy.php
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Smart_Custom_Fields_Field_Taxonomy
|
4 |
-
* Version : 1.4.
|
5 |
* Author : inc2734
|
6 |
* Created : October 7, 2014
|
7 |
-
* Modified : June
|
8 |
* License : GPLv2 or later
|
9 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
*/
|
@@ -46,20 +46,18 @@ class Smart_Custom_Fields_Field_Taxonomy extends Smart_Custom_Fields_Field_Base
|
|
46 |
* @param string $hook
|
47 |
*/
|
48 |
public function admin_enqueue_scripts( $hook ) {
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
) );
|
62 |
-
}
|
63 |
}
|
64 |
|
65 |
/**
|
1 |
<?php
|
2 |
/**
|
3 |
* Smart_Custom_Fields_Field_Taxonomy
|
4 |
+
* Version : 1.4.1
|
5 |
* Author : inc2734
|
6 |
* Created : October 7, 2014
|
7 |
+
* Modified : June 22, 2016
|
8 |
* License : GPLv2 or later
|
9 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
*/
|
46 |
* @param string $hook
|
47 |
*/
|
48 |
public function admin_enqueue_scripts( $hook ) {
|
49 |
+
wp_enqueue_script(
|
50 |
+
SCF_Config::PREFIX . 'editor-relation-taxonomies',
|
51 |
+
plugins_url( SCF_Config::NAME ) . '/js/editor-relation-taxonomies.js',
|
52 |
+
array( 'jquery' ),
|
53 |
+
null,
|
54 |
+
true
|
55 |
+
);
|
56 |
+
wp_localize_script( SCF_Config::PREFIX . 'editor-relation-taxonomies', 'smart_cf_relation_taxonomies', array(
|
57 |
+
'endpoint' => admin_url( 'admin-ajax.php' ),
|
58 |
+
'action' => SCF_Config::PREFIX . 'relational-terms-search',
|
59 |
+
'nonce' => wp_create_nonce( SCF_Config::NAME . '-relation-taxonomies' )
|
60 |
+
) );
|
|
|
|
|
61 |
}
|
62 |
|
63 |
/**
|
classes/models/class.revisions.php
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Smart_Custom_Fields_Revisions
|
4 |
-
* Version : 1.1.
|
5 |
* Author : inc2734
|
6 |
* Created : September 23, 2014
|
7 |
-
* Modified :
|
8 |
* License : GPLv2 or later
|
9 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
*/
|
@@ -76,7 +76,7 @@ class Smart_Custom_Fields_Revisions {
|
|
76 |
|
77 |
/**
|
78 |
* プレビューのときはプレビューのメタデータを返す。ただし、アイキャッチはリビジョンが無いので除外する
|
79 |
-
*
|
80 |
* @param mixed $value
|
81 |
* @param int $post_id
|
82 |
* @param string $meta_key
|
@@ -88,7 +88,7 @@ class Smart_Custom_Fields_Revisions {
|
|
88 |
if ( is_null( SCF::get_field( get_post( $post_id ), $meta_key ) ) ) {
|
89 |
return $value;
|
90 |
}
|
91 |
-
|
92 |
if ( $preview_id = $this->get_preview_id( $post_id ) && $meta_key !== '_thumbnail_id' ) {
|
93 |
if ( $post_id !== $preview_id ) {
|
94 |
$value = get_post_meta( $preview_id, $meta_key, $single );
|
@@ -99,7 +99,7 @@ class Smart_Custom_Fields_Revisions {
|
|
99 |
|
100 |
/**
|
101 |
* プレビューの Post ID を返す
|
102 |
-
*
|
103 |
* @param int $post_id
|
104 |
* @return int $preview_id
|
105 |
*/
|
@@ -116,7 +116,7 @@ class Smart_Custom_Fields_Revisions {
|
|
116 |
|
117 |
/**
|
118 |
* リビジョン比較画面でメタデータを表示させるためにキーを追加する
|
119 |
-
*
|
120 |
* @param array $fields
|
121 |
* @return array $fields
|
122 |
*/
|
@@ -137,7 +137,7 @@ class Smart_Custom_Fields_Revisions {
|
|
137 |
|
138 |
/**
|
139 |
* リビジョン比較画面にメタデータを表示
|
140 |
-
*
|
141 |
* @param $value
|
142 |
* @param $column
|
143 |
* @param array $post
|
@@ -165,7 +165,7 @@ class Smart_Custom_Fields_Revisions {
|
|
165 |
$output .= sprintf( "[%s]\n", implode( ', ', $value ) );
|
166 |
}
|
167 |
} else {
|
168 |
-
$output .=
|
169 |
}
|
170 |
}
|
171 |
return $output;
|
@@ -173,7 +173,7 @@ class Smart_Custom_Fields_Revisions {
|
|
173 |
|
174 |
/**
|
175 |
* false ならリビジョンとして保存される
|
176 |
-
*
|
177 |
* @param bool $check_for_changes
|
178 |
* @param WP_Post $last_revision 最新のリビジョン
|
179 |
* @param WP_Post $post 現在の投稿
|
1 |
<?php
|
2 |
/**
|
3 |
* Smart_Custom_Fields_Revisions
|
4 |
+
* Version : 1.1.4
|
5 |
* Author : inc2734
|
6 |
* Created : September 23, 2014
|
7 |
+
* Modified : June 22, 2016
|
8 |
* License : GPLv2 or later
|
9 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
*/
|
76 |
|
77 |
/**
|
78 |
* プレビューのときはプレビューのメタデータを返す。ただし、アイキャッチはリビジョンが無いので除外する
|
79 |
+
*
|
80 |
* @param mixed $value
|
81 |
* @param int $post_id
|
82 |
* @param string $meta_key
|
88 |
if ( is_null( SCF::get_field( get_post( $post_id ), $meta_key ) ) ) {
|
89 |
return $value;
|
90 |
}
|
91 |
+
|
92 |
if ( $preview_id = $this->get_preview_id( $post_id ) && $meta_key !== '_thumbnail_id' ) {
|
93 |
if ( $post_id !== $preview_id ) {
|
94 |
$value = get_post_meta( $preview_id, $meta_key, $single );
|
99 |
|
100 |
/**
|
101 |
* プレビューの Post ID を返す
|
102 |
+
*
|
103 |
* @param int $post_id
|
104 |
* @return int $preview_id
|
105 |
*/
|
116 |
|
117 |
/**
|
118 |
* リビジョン比較画面でメタデータを表示させるためにキーを追加する
|
119 |
+
*
|
120 |
* @param array $fields
|
121 |
* @return array $fields
|
122 |
*/
|
137 |
|
138 |
/**
|
139 |
* リビジョン比較画面にメタデータを表示
|
140 |
+
*
|
141 |
* @param $value
|
142 |
* @param $column
|
143 |
* @param array $post
|
165 |
$output .= sprintf( "[%s]\n", implode( ', ', $value ) );
|
166 |
}
|
167 |
} else {
|
168 |
+
$output .= sprintf( "%s\n", $value );
|
169 |
}
|
170 |
}
|
171 |
return $output;
|
173 |
|
174 |
/**
|
175 |
* false ならリビジョンとして保存される
|
176 |
+
*
|
177 |
* @param bool $check_for_changes
|
178 |
* @param WP_Post $last_revision 最新のリビジョン
|
179 |
* @param WP_Post $post 現在の投稿
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ 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.5.2
|
7 |
-
Stable tag: 2.1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -125,6 +125,10 @@ You can send your own language pack to me.
|
|
125 |
|
126 |
== Changelog ==
|
127 |
|
|
|
|
|
|
|
|
|
128 |
= 2.1.0 =
|
129 |
* Support separated key and value in select, checkbox, radio.
|
130 |
* Added switching editor mode tab in wysiwyg field.
|
4 |
Tags: plugin, custom field, custom, field, meta, meta field, repeat, repeatable
|
5 |
Requires at least: 3.9
|
6 |
Tested up to: 4.5.2
|
7 |
+
Stable tag: 2.1.1
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
125 |
|
126 |
== Changelog ==
|
127 |
|
128 |
+
= 2.1.1 =
|
129 |
+
* Fix revision lines duplication (by [@hanamura](https://github.com/hanamura))
|
130 |
+
* Fixed a bug that relation felds don't work in options page.
|
131 |
+
|
132 |
= 2.1.0 =
|
133 |
* Support separated key and value in select, checkbox, radio.
|
134 |
* Added switching editor mode tab in wysiwyg field.
|
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: 2.1.
|
7 |
* Author: inc2734
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: October 9, 2014
|
10 |
-
* Modified: June
|
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: 2.1.1
|
7 |
* Author: inc2734
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: October 9, 2014
|
10 |
+
* Modified: June 22, 2016
|
11 |
* Text Domain: smart-custom-fields
|
12 |
* Domain Path: /languages
|
13 |
* License: GPLv2 or later
|