Version Description
- UX Improvement of settings page.
Download this release
Release Info
Developer | inc2734 |
Plugin | Smart Custom Fields |
Version | 1.1.1 |
Comparing to | |
See all releases |
Code changes from version 1.0.3 to 1.1.1
- classes/class.settings.php +9 -3
- classes/fields/class.field-datepicker.php +191 -0
- css/settings.css +52 -8
- js/editor-datepicker.js +27 -0
- js/settings.js +13 -9
- readme.txt +9 -2
- smart-custom-fields.php +2 -2
classes/class.settings.php
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Smart_Custom_Fields_Settings
|
4 |
-
* Version : 1.0.
|
5 |
* Author : Takashi Kitajima
|
6 |
* Created : September 23, 2014
|
7 |
-
* Modified :
|
8 |
* License : GPLv2
|
9 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
*/
|
@@ -130,6 +130,7 @@ class Smart_Custom_Fields_Settings {
|
|
130 |
<div class="<?php echo esc_attr( SCF_Config::PREFIX . 'group' ); ?> <?php $this->add_hide_class( $group_key ); ?>">
|
131 |
<div class="btn-remove-group"><b>x</b></div>
|
132 |
<div class="<?php echo esc_attr( SCF_Config::PREFIX . 'group-repeat' ); ?>">
|
|
|
133 |
<label>
|
134 |
<input type="checkbox"
|
135 |
name="<?php echo esc_attr( SCF_Config::NAME . '[' . $group_key . '][repeat]' ); ?>"
|
@@ -160,9 +161,14 @@ class Smart_Custom_Fields_Settings {
|
|
160 |
$field_label = $this->get( 'label', $field );
|
161 |
if ( !$field_label ) {
|
162 |
$field_label = $this->get( 'name', $field );
|
|
|
|
|
|
|
163 |
}
|
164 |
?>
|
165 |
-
<div class="
|
|
|
|
|
166 |
<table class="<?php $this->add_hide_class( !$this->get( 'name', $field ) ); ?>">
|
167 |
<tr>
|
168 |
<th><?php esc_html_e( 'Name', 'smart-custom-fields' ); ?><span class="<?php echo esc_attr( SCF_Config::PREFIX . 'require' ); ?>">*</span></th>
|
1 |
<?php
|
2 |
/**
|
3 |
* Smart_Custom_Fields_Settings
|
4 |
+
* Version : 1.0.2
|
5 |
* Author : Takashi Kitajima
|
6 |
* Created : September 23, 2014
|
7 |
+
* Modified : January 22, 2015
|
8 |
* License : GPLv2
|
9 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
*/
|
130 |
<div class="<?php echo esc_attr( SCF_Config::PREFIX . 'group' ); ?> <?php $this->add_hide_class( $group_key ); ?>">
|
131 |
<div class="btn-remove-group"><b>x</b></div>
|
132 |
<div class="<?php echo esc_attr( SCF_Config::PREFIX . 'group-repeat' ); ?>">
|
133 |
+
<div class="<?php echo esc_attr( SCF_Config::PREFIX . 'icon-handle' ); ?>"></div>
|
134 |
<label>
|
135 |
<input type="checkbox"
|
136 |
name="<?php echo esc_attr( SCF_Config::NAME . '[' . $group_key . '][repeat]' ); ?>"
|
161 |
$field_label = $this->get( 'label', $field );
|
162 |
if ( !$field_label ) {
|
163 |
$field_label = $this->get( 'name', $field );
|
164 |
+
if ( !$field_label ) {
|
165 |
+
$field_label = " ";
|
166 |
+
}
|
167 |
}
|
168 |
?>
|
169 |
+
<div class="<?php echo esc_attr( SCF_Config::PREFIX . 'icon-handle' ); ?>"></div>
|
170 |
+
<b class="btn-remove-field">x</b>
|
171 |
+
<div class="field-label"><?php echo esc_html( $field_label ); ?></div>
|
172 |
<table class="<?php $this->add_hide_class( !$this->get( 'name', $field ) ); ?>">
|
173 |
<tr>
|
174 |
<th><?php esc_html_e( 'Name', 'smart-custom-fields' ); ?><span class="<?php echo esc_attr( SCF_Config::PREFIX . 'require' ); ?>">*</span></th>
|
classes/fields/class.field-datepicker.php
ADDED
@@ -0,0 +1,191 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Smart_Custom_Fields_Field_Datepicker
|
4 |
+
* Version : 1.0.0
|
5 |
+
* Author : Takashi Kitajima
|
6 |
+
* Created : January 17, 2015
|
7 |
+
* Modified :
|
8 |
+
* License : GPLv2
|
9 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
+
*/
|
11 |
+
class Smart_Custom_Fields_Field_Datepicker extends Smart_Custom_Fields_Field_Base {
|
12 |
+
|
13 |
+
/**
|
14 |
+
* init
|
15 |
+
* @return array ( name, label, optgroup )
|
16 |
+
*/
|
17 |
+
protected function init() {
|
18 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
|
19 |
+
return array(
|
20 |
+
'name' => 'datepicker',
|
21 |
+
'label' => __( 'Date picker', 'smart-custom-fields' ),
|
22 |
+
'optgroup' => 'other-fields',
|
23 |
+
);
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* admin_enqueue_scripts
|
28 |
+
* @param string $hook
|
29 |
+
*/
|
30 |
+
public function admin_enqueue_scripts( $hook ) {
|
31 |
+
global $wp_scripts;
|
32 |
+
if ( in_array( $hook, array( 'post-new.php', 'post.php' ) ) ) {
|
33 |
+
$ui = $wp_scripts->query( 'jquery-ui-core' );
|
34 |
+
wp_enqueue_style(
|
35 |
+
'jquery.ui',
|
36 |
+
'//ajax.googleapis.com/ajax/libs/jqueryui/' . $ui->ver . '/themes/smoothness/jquery-ui.min.css',
|
37 |
+
array(),
|
38 |
+
$ui->ver
|
39 |
+
);
|
40 |
+
wp_enqueue_script( 'jquery-ui-datepicker' );
|
41 |
+
wp_enqueue_script(
|
42 |
+
SCF_Config::PREFIX . 'datepicker',
|
43 |
+
plugins_url( '../../js/editor-datepicker.js', __FILE__ ),
|
44 |
+
array( 'jquery', 'jquery-ui-datepicker' ),
|
45 |
+
false,
|
46 |
+
true
|
47 |
+
);
|
48 |
+
}
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* get_field
|
53 |
+
* @param array $field フィールドの情報
|
54 |
+
* @param int $index インデックス番号
|
55 |
+
* @param mixed $value 保存されている値(check のときだけ配列)
|
56 |
+
*/
|
57 |
+
public function get_field( $field, $index, $value ) {
|
58 |
+
$name = $this->get_name_attribute( $field['name'], $index );
|
59 |
+
$disabled = $this->get_disable_attribute( $index );
|
60 |
+
|
61 |
+
$js = array(
|
62 |
+
'showMonthAfterYear' => true,
|
63 |
+
'changeYear' => true,
|
64 |
+
'changeMonth' => true,
|
65 |
+
);
|
66 |
+
// 日本語の場合は日本語表記に変更
|
67 |
+
if ( get_locale() === 'ja' ) {
|
68 |
+
$js = array_merge( $js, array(
|
69 |
+
'yearSuffix' => '年',
|
70 |
+
'dateFormat' => 'yy-mm-dd',
|
71 |
+
'dayNames' => array(
|
72 |
+
'日曜日', '月曜日', '火曜日', '水曜日', '木曜日', '金曜日', '土曜日',
|
73 |
+
),
|
74 |
+
'dayNamesMin' => array(
|
75 |
+
'日', '月', '火', '水', '木', '金', '土',
|
76 |
+
),
|
77 |
+
'dayNamesShort' => array(
|
78 |
+
'日曜', '月曜', '火曜', '水曜', '木曜', '金曜', '土曜',
|
79 |
+
),
|
80 |
+
'monthNames' => array(
|
81 |
+
'1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月',
|
82 |
+
),
|
83 |
+
'monthNamesShort' => array(
|
84 |
+
'1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月',
|
85 |
+
)
|
86 |
+
) );
|
87 |
+
}
|
88 |
+
if ( !empty( $field['date_format'] ) ) {
|
89 |
+
$js['dateFormat'] = $field['date_format'];
|
90 |
+
}
|
91 |
+
if ( !empty( $field['max_date'] ) ) {
|
92 |
+
$js['maxDate'] = $field['max_date'];
|
93 |
+
}
|
94 |
+
if ( !empty( $field['min_date'] ) ) {
|
95 |
+
$js['minDate'] = $field['min_date'];
|
96 |
+
}
|
97 |
+
$data_js = json_encode( $js );
|
98 |
+
|
99 |
+
return sprintf(
|
100 |
+
'<input type="text" name="%s" value="%s" class="%s" %s data-js=\'%s\' />',
|
101 |
+
esc_attr( $name ),
|
102 |
+
esc_attr( $value ),
|
103 |
+
esc_attr( SCF_Config::PREFIX . 'datepicker' ),
|
104 |
+
disabled( true, $disabled, false ),
|
105 |
+
$data_js
|
106 |
+
);
|
107 |
+
}
|
108 |
+
|
109 |
+
/**
|
110 |
+
* display_field_options
|
111 |
+
* @param int $group_key
|
112 |
+
* @param int $field_key
|
113 |
+
*/
|
114 |
+
public function display_field_options( $group_key, $field_key ) {
|
115 |
+
?>
|
116 |
+
<tr>
|
117 |
+
<th><?php esc_html_e( 'Default', 'smart-custom-fields' ); ?></th>
|
118 |
+
<td>
|
119 |
+
<input type="text"
|
120 |
+
name="<?php echo esc_attr( $this->get_field_name( $group_key, $field_key, 'default' ) ); ?>"
|
121 |
+
class="widefat"
|
122 |
+
value="<?php echo esc_attr( $this->get_field_value( 'default' ) ); ?>" />
|
123 |
+
</td>
|
124 |
+
</tr>
|
125 |
+
<tr>
|
126 |
+
<th><?php esc_html_e( 'Date Format', 'smart-custom-fields' ); ?></th>
|
127 |
+
<td>
|
128 |
+
<input type="text"
|
129 |
+
name="<?php echo esc_attr( $this->get_field_name( $group_key, $field_key, 'date_format' ) ); ?>"
|
130 |
+
class="widefat"
|
131 |
+
value="<?php echo esc_attr( $this->get_field_value( 'date_format' ) ); ?>"
|
132 |
+
/><br />
|
133 |
+
<span class="<?php echo esc_attr( SCF_Config::PREFIX ); ?>notes">
|
134 |
+
<?php esc_html_e( 'e.g dd/mm/yy', 'smart-custom-fields' ); ?>
|
135 |
+
<?php printf(
|
136 |
+
esc_html( 'Prease see %sdateFormat%s', 'smart-custom-fields' ),
|
137 |
+
'<a href="http://api.jqueryui.com/datepicker/#option-dateFormat" target="_blank">',
|
138 |
+
'</a>'
|
139 |
+
); ?>
|
140 |
+
</span>
|
141 |
+
</td>
|
142 |
+
</tr>
|
143 |
+
<tr>
|
144 |
+
<th><?php esc_html_e( 'Max Date', 'smart-custom-fields' ); ?></th>
|
145 |
+
<td>
|
146 |
+
<input type="text"
|
147 |
+
name="<?php echo esc_attr( $this->get_field_name( $group_key, $field_key, 'max_date' ) ); ?>"
|
148 |
+
class="widefat"
|
149 |
+
value="<?php echo esc_attr( $this->get_field_value( 'max_date' ) ); ?>"
|
150 |
+
/><br />
|
151 |
+
<span class="<?php echo esc_attr( SCF_Config::PREFIX ); ?>notes">
|
152 |
+
<?php esc_html_e( 'e.g +1m +1w', 'smart-custom-fields' ); ?>
|
153 |
+
<?php printf(
|
154 |
+
esc_html( 'Prease see %smaxData%s', 'smart-custom-fields' ),
|
155 |
+
'<a href="http://api.jqueryui.com/datepicker/#option-maxDate" target="_blank">',
|
156 |
+
'</a>'
|
157 |
+
); ?>
|
158 |
+
</span>
|
159 |
+
</td>
|
160 |
+
</tr>
|
161 |
+
<tr>
|
162 |
+
<th><?php esc_html_e( 'Min Date', 'smart-custom-fields' ); ?></th>
|
163 |
+
<td>
|
164 |
+
<input type="text"
|
165 |
+
name="<?php echo esc_attr( $this->get_field_name( $group_key, $field_key, 'min_date' ) ); ?>"
|
166 |
+
class="widefat"
|
167 |
+
value="<?php echo esc_attr( $this->get_field_value( 'min_date' ) ); ?>"
|
168 |
+
/><br />
|
169 |
+
<span class="<?php echo esc_attr( SCF_Config::PREFIX ); ?>notes">
|
170 |
+
<?php esc_html_e( 'e.g +1m +1w', 'smart-custom-fields' ); ?>
|
171 |
+
<?php printf(
|
172 |
+
esc_html( 'Prease see %sminData%s', 'smart-custom-fields' ),
|
173 |
+
'<a href="http://api.jqueryui.com/datepicker/#option-minDate" target="_blank">',
|
174 |
+
'</a>'
|
175 |
+
); ?>
|
176 |
+
</span>
|
177 |
+
</td>
|
178 |
+
</tr>
|
179 |
+
<tr>
|
180 |
+
<th><?php esc_html_e( 'Notes', 'smart-custom-fields' ); ?></th>
|
181 |
+
<td>
|
182 |
+
<input type="text"
|
183 |
+
name="<?php echo esc_attr( $this->get_field_name( $group_key, $field_key, 'notes' ) ); ?>"
|
184 |
+
class="widefat"
|
185 |
+
value="<?php echo esc_attr( $this->get_field_value( 'notes' ) ); ?>"
|
186 |
+
/>
|
187 |
+
</td>
|
188 |
+
</tr>
|
189 |
+
<?php
|
190 |
+
}
|
191 |
+
}
|
css/settings.css
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
/**
|
2 |
* settings.css
|
3 |
-
* Version : 1.0.
|
4 |
* Author : Takashi Kitajima
|
5 |
* Created : September 23, 2014
|
6 |
-
* Modified :
|
7 |
* License : GPLv2
|
8 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
*/
|
@@ -37,6 +37,10 @@
|
|
37 |
font-size: 90%;
|
38 |
margin-left: 3px;
|
39 |
}
|
|
|
|
|
|
|
|
|
40 |
|
41 |
/**
|
42 |
* .btn-remove-group
|
@@ -44,7 +48,7 @@
|
|
44 |
.smart-cf-group .btn-remove-group {
|
45 |
cursor: pointer;
|
46 |
position: absolute;
|
47 |
-
top:
|
48 |
right: 10px;
|
49 |
}
|
50 |
|
@@ -59,9 +63,12 @@
|
|
59 |
* .smart-cf-group-repeat
|
60 |
*/
|
61 |
.smart-cf-group .smart-cf-group-repeat {
|
62 |
-
cursor: move;
|
63 |
margin: 0 0 5px;
|
64 |
}
|
|
|
|
|
|
|
|
|
65 |
|
66 |
/**
|
67 |
* .smart-cf-group-names
|
@@ -84,6 +91,13 @@
|
|
84 |
margin-top: 2px 0;
|
85 |
}
|
86 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
/** ==================================================
|
88 |
* .smart-cf-field
|
89 |
*/
|
@@ -92,6 +106,8 @@
|
|
92 |
border: #ddd solid 1px;
|
93 |
margin: 5px 0 0;
|
94 |
padding: 10px;
|
|
|
|
|
95 |
}
|
96 |
.smart-cf-group .smart-cf-field:first-child {
|
97 |
margin-top: 0;
|
@@ -116,15 +132,29 @@
|
|
116 |
}
|
117 |
|
118 |
/**
|
119 |
-
* .
|
120 |
*/
|
121 |
-
.smart-cf-group .smart-cf-field .
|
122 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
123 |
position: relative;
|
124 |
overflow: hidden;
|
125 |
*zoom: 1;
|
126 |
}
|
127 |
-
|
|
|
|
|
|
|
|
|
|
|
128 |
float: right;
|
129 |
}
|
130 |
|
@@ -151,3 +181,17 @@
|
|
151 |
.smart-cf-group .smart-cf-field table.hide {
|
152 |
display: none;
|
153 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
/**
|
2 |
* settings.css
|
3 |
+
* Version : 1.0.1
|
4 |
* Author : Takashi Kitajima
|
5 |
* Created : September 23, 2014
|
6 |
+
* Modified : January 22, 2015
|
7 |
* License : GPLv2
|
8 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
*/
|
37 |
font-size: 90%;
|
38 |
margin-left: 3px;
|
39 |
}
|
40 |
+
.smart-cf-group .smart-cf-notes {
|
41 |
+
color: #999;
|
42 |
+
font-size: 90%;
|
43 |
+
}
|
44 |
|
45 |
/**
|
46 |
* .btn-remove-group
|
48 |
.smart-cf-group .btn-remove-group {
|
49 |
cursor: pointer;
|
50 |
position: absolute;
|
51 |
+
top: 10px;
|
52 |
right: 10px;
|
53 |
}
|
54 |
|
63 |
* .smart-cf-group-repeat
|
64 |
*/
|
65 |
.smart-cf-group .smart-cf-group-repeat {
|
|
|
66 |
margin: 0 0 5px;
|
67 |
}
|
68 |
+
.smart-cf-group .smart-cf-group-repeat label {
|
69 |
+
position: relative;
|
70 |
+
top: -2px;
|
71 |
+
}
|
72 |
|
73 |
/**
|
74 |
* .smart-cf-group-names
|
91 |
margin-top: 2px 0;
|
92 |
}
|
93 |
|
94 |
+
/** ==================================================
|
95 |
+
* .smart-cf-fields
|
96 |
+
*/
|
97 |
+
.smart-cf-group .smart-cf-fields {
|
98 |
+
margin-top: 7px;
|
99 |
+
}
|
100 |
+
|
101 |
/** ==================================================
|
102 |
* .smart-cf-field
|
103 |
*/
|
106 |
border: #ddd solid 1px;
|
107 |
margin: 5px 0 0;
|
108 |
padding: 10px;
|
109 |
+
overflow: hidden;
|
110 |
+
*zoom: 1;
|
111 |
}
|
112 |
.smart-cf-group .smart-cf-field:first-child {
|
113 |
margin-top: 0;
|
132 |
}
|
133 |
|
134 |
/**
|
135 |
+
* .smart-cf-icon-handle
|
136 |
*/
|
137 |
+
.smart-cf-group .smart-cf-field .smart-cf-icon-handle {
|
138 |
+
float: left;
|
139 |
+
margin-top: 4px;
|
140 |
+
margin-right: 8px;
|
141 |
+
}
|
142 |
+
|
143 |
+
/**
|
144 |
+
* .field-label
|
145 |
+
*/
|
146 |
+
.smart-cf-group .smart-cf-field .field-label {
|
147 |
+
cursor: pointer;
|
148 |
position: relative;
|
149 |
overflow: hidden;
|
150 |
*zoom: 1;
|
151 |
}
|
152 |
+
|
153 |
+
/**
|
154 |
+
* .btn-remove-field
|
155 |
+
*/
|
156 |
+
.smart-cf-group .smart-cf-field .btn-remove-field {
|
157 |
+
cursor: pointer;
|
158 |
float: right;
|
159 |
}
|
160 |
|
181 |
.smart-cf-group .smart-cf-field table.hide {
|
182 |
display: none;
|
183 |
}
|
184 |
+
|
185 |
+
/** ==================================================
|
186 |
+
* classes
|
187 |
+
*/
|
188 |
+
.smart-cf-icon-handle {
|
189 |
+
background: url( ../images/handle.png ) no-repeat;
|
190 |
+
cursor: move;
|
191 |
+
display: inline-block;
|
192 |
+
margin-right: 10px;
|
193 |
+
height: 10px;
|
194 |
+
width: 10px;
|
195 |
+
overflow: hidden;
|
196 |
+
position: relative;
|
197 |
+
}
|
js/editor-datepicker.js
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* datepicker.js
|
3 |
+
* Version : 1.0.0
|
4 |
+
* Author : Takashi Kitajima
|
5 |
+
* Created : January 18, 2015
|
6 |
+
* Modified :
|
7 |
+
* License : GPLv2
|
8 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
+
*/
|
10 |
+
jQuery( function( $ ) {
|
11 |
+
$( '.smart-cf-meta-box-table' ).each( function( i, e ) {
|
12 |
+
$( e ).find( '.smart-cf-datepicker' ).each( function( i, e ) {
|
13 |
+
if ( $( e ).attr( 'disabled' ) !== 'disabled' ) {
|
14 |
+
$( e ).datepicker( $( e ).data( 'js' ) );
|
15 |
+
}
|
16 |
+
} );
|
17 |
+
} );
|
18 |
+
|
19 |
+
$( document ).on( 'smart-cf-after-add-group', function( e, button ) {
|
20 |
+
var parent = $( button ).parents( '.smart-cf-meta-box-repeat-tables' );
|
21 |
+
parent.find( '.smart-cf-datepicker' ).each( function( i, e ) {
|
22 |
+
if ( $( e ).attr( 'disabled' ) !== 'disabled' ) {
|
23 |
+
$( e ).datepicker( $( e ).data( 'js' ) );
|
24 |
+
}
|
25 |
+
} );
|
26 |
+
} );
|
27 |
+
} );
|
js/settings.js
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
/**
|
2 |
* settings.js
|
3 |
-
* Version : 1.0.
|
4 |
* Author : Takashi Kitajima
|
5 |
* Created : September 23, 2014
|
6 |
-
* Modified :
|
7 |
* License : GPLv2
|
8 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
*/
|
@@ -13,7 +13,7 @@ jQuery( function( $ ) {
|
|
13 |
var btn_add_group = wrapper.find( '.btn-add-group' );
|
14 |
var btn_remove_group = wrapper.find( '.btn-remove-group b' );
|
15 |
var btn_add_field = wrapper.find( '.btn-add-field' );
|
16 |
-
var btn_remove_field = wrapper.find( '.btn-remove-field
|
17 |
var group_class = '.smart-cf-group';
|
18 |
var field_class = '.smart-cf-field';
|
19 |
var duplicate_alert_class = '.smart-cf-duplicate-alert';
|
@@ -56,21 +56,21 @@ jQuery( function( $ ) {
|
|
56 |
*/
|
57 |
$( '.smart-cf-groups' ).sortable( {
|
58 |
cursor: 'move',
|
59 |
-
handle: '.smart-cf-
|
60 |
} );
|
61 |
$( '.smart-cf-fields' ).sortable( {
|
62 |
cursor: 'move',
|
63 |
-
handle: '.
|
64 |
} );
|
65 |
|
66 |
/**
|
67 |
* フィールドの開閉
|
68 |
*/
|
69 |
-
$( '.
|
70 |
-
var
|
71 |
var table = $( this ).parents( field_class ).find( 'table' );
|
72 |
if ( table.hasClass( 'hide' ) ) {
|
73 |
-
|
74 |
table.fadeIn( 'fast', function() {
|
75 |
$( this ).removeClass( 'hide' );
|
76 |
} );
|
@@ -81,7 +81,11 @@ jQuery( function( $ ) {
|
|
81 |
}
|
82 |
table.fadeOut( 'fast', function() {
|
83 |
$( this ).addClass( 'hide' );
|
84 |
-
|
|
|
|
|
|
|
|
|
85 |
} );
|
86 |
}
|
87 |
} );
|
1 |
/**
|
2 |
* settings.js
|
3 |
+
* Version : 1.0.1
|
4 |
* Author : Takashi Kitajima
|
5 |
* Created : September 23, 2014
|
6 |
+
* Modified : January 22, 2015
|
7 |
* License : GPLv2
|
8 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
*/
|
13 |
var btn_add_group = wrapper.find( '.btn-add-group' );
|
14 |
var btn_remove_group = wrapper.find( '.btn-remove-group b' );
|
15 |
var btn_add_field = wrapper.find( '.btn-add-field' );
|
16 |
+
var btn_remove_field = wrapper.find( '.btn-remove-field' );
|
17 |
var group_class = '.smart-cf-group';
|
18 |
var field_class = '.smart-cf-field';
|
19 |
var duplicate_alert_class = '.smart-cf-duplicate-alert';
|
56 |
*/
|
57 |
$( '.smart-cf-groups' ).sortable( {
|
58 |
cursor: 'move',
|
59 |
+
handle: '.smart-cf-icon-handle'
|
60 |
} );
|
61 |
$( '.smart-cf-fields' ).sortable( {
|
62 |
cursor: 'move',
|
63 |
+
handle: '.smart-cf-icon-handle'
|
64 |
} );
|
65 |
|
66 |
/**
|
67 |
* フィールドの開閉
|
68 |
*/
|
69 |
+
$( '.field-label' ).click( function() {
|
70 |
+
var field_label = $( this );
|
71 |
var table = $( this ).parents( field_class ).find( 'table' );
|
72 |
if ( table.hasClass( 'hide' ) ) {
|
73 |
+
field_label.html( " " );
|
74 |
table.fadeIn( 'fast', function() {
|
75 |
$( this ).removeClass( 'hide' );
|
76 |
} );
|
81 |
}
|
82 |
table.fadeOut( 'fast', function() {
|
83 |
$( this ).addClass( 'hide' );
|
84 |
+
if ( label ) {
|
85 |
+
field_label.text( label );
|
86 |
+
} else {
|
87 |
+
field_label.html( " " );
|
88 |
+
}
|
89 |
} );
|
90 |
}
|
91 |
} );
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: inc2734
|
|
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.
|
7 |
-
Stable tag: 1.
|
8 |
License: GPLv2
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -32,6 +32,7 @@ https://www.youtube.com/watch?v=WxPZurn0yvI
|
|
32 |
* File
|
33 |
* Relation
|
34 |
* Color picker
|
|
|
35 |
|
36 |
= How to get meta data ? =
|
37 |
|
@@ -61,6 +62,12 @@ https://github.com/inc2734/smart-custom-fields/
|
|
61 |
|
62 |
== Changelog ==
|
63 |
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
= 1.0.3 =
|
65 |
* Fixed a bug that can't be get the correct data when specify a $post_id attribute to SCF::get(). For example SCF::get( 'key', $post_id )
|
66 |
|
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.1
|
7 |
+
Stable tag: 1.1.1
|
8 |
License: GPLv2
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
32 |
* File
|
33 |
* Relation
|
34 |
* Color picker
|
35 |
+
* Date picker
|
36 |
|
37 |
= How to get meta data ? =
|
38 |
|
62 |
|
63 |
== Changelog ==
|
64 |
|
65 |
+
= 1.1.1 =
|
66 |
+
* UX Improvement of settings page.
|
67 |
+
|
68 |
+
= 1.1.0 =
|
69 |
+
* Add date picker field.
|
70 |
+
|
71 |
= 1.0.3 =
|
72 |
* Fixed a bug that can't be get the correct data when specify a $post_id attribute to SCF::get(). For example SCF::get( 'key', $post_id )
|
73 |
|
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.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: October 9, 2014
|
10 |
-
* Modified:
|
11 |
* Text Domain: smart-custom-fields
|
12 |
* Domain Path: /languages/
|
13 |
* License: GPLv2
|
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.1.1
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: October 9, 2014
|
10 |
+
* Modified: January 22, 2015
|
11 |
* Text Domain: smart-custom-fields
|
12 |
* Domain Path: /languages/
|
13 |
* License: GPLv2
|