Version Description
Download this release
Release Info
Developer | Hiroaki Miyashita |
Plugin | Custom Field Template |
Version | 0.8 |
Comparing to | |
See all releases |
Code changes from version 0.7.4 to 0.8
- custom-field-template-ja.mo +0 -0
- custom-field-template-ja.po +58 -47
- custom-field-template-ru_RU.mo +0 -0
- custom-field-template-ru_RU.po +184 -0
- custom-field-template.php +176 -58
- readme.txt +7 -1
custom-field-template-ja.mo
CHANGED
Binary file
|
custom-field-template-ja.po
CHANGED
@@ -2,8 +2,8 @@ msgid ""
|
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: Custom Field Template\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
-
"POT-Creation-Date:
|
6 |
-
"PO-Revision-Date:
|
7 |
"Last-Translator: \n"
|
8 |
"Language-Team: \n"
|
9 |
"MIME-Version: 1.0\n"
|
@@ -18,9 +18,9 @@ msgstr ""
|
|
18 |
|
19 |
#: custom-field-template/custom-field-template.php:83
|
20 |
#: custom-field-template/custom-field-template.php:84
|
21 |
-
#: custom-field-template/custom-field-template.php:
|
22 |
-
#: custom-field-template/custom-field-template.php:
|
23 |
-
#: custom-field-template/custom-field-template.php:
|
24 |
msgid "Custom Field Template"
|
25 |
msgstr "カスタムフィールドテンプレート"
|
26 |
|
@@ -32,150 +32,161 @@ msgstr "設定"
|
|
32 |
msgid "Default Template"
|
33 |
msgstr "デフォルトテンプレート"
|
34 |
|
35 |
-
#: custom-field-template/custom-field-template.php:
|
36 |
-
#: custom-field-template/custom-field-template.php:
|
37 |
-
#: custom-field-template/custom-field-template.php:
|
|
|
38 |
msgid "Options updated."
|
39 |
msgstr "オプションは更新されました。"
|
40 |
|
41 |
-
#: custom-field-template/custom-field-template.php:
|
42 |
msgid "Options resetted."
|
43 |
msgstr "オプションはリセットされました。"
|
44 |
|
45 |
-
#: custom-field-template/custom-field-template.php:
|
46 |
msgid "Options deleted."
|
47 |
msgstr "オプションは削除されました。"
|
48 |
|
49 |
-
#: custom-field-template/custom-field-template.php:
|
50 |
msgid "Custom Field Template Options"
|
51 |
msgstr "カスタムフィールドテンプレートオプション"
|
52 |
|
53 |
-
#: custom-field-template/custom-field-template.php:
|
54 |
#, php-format
|
55 |
msgid "Template Title %d"
|
56 |
msgstr "テンプレートタイトル %d"
|
57 |
|
58 |
-
#: custom-field-template/custom-field-template.php:
|
59 |
#, php-format
|
60 |
msgid "Template Instruction %d"
|
61 |
msgstr "テンプレートインストラクション %d"
|
62 |
|
63 |
-
#: custom-field-template/custom-field-template.php:
|
64 |
#, php-format
|
65 |
msgid "Template Content %d"
|
66 |
msgstr "テンプレートコンテンツ %d"
|
67 |
|
68 |
-
#: custom-field-template/custom-field-template.php:
|
69 |
msgid "In case that you would like to insert multiple images at once in use of the custom field media buttons"
|
70 |
msgstr "カスタムフィールへの画像挿入を一度に複数枚実行する場合"
|
71 |
|
72 |
-
#: custom-field-template/custom-field-template.php:
|
73 |
msgid "Use multiple image inset"
|
74 |
msgstr "複数画像挿入を利用する"
|
75 |
|
76 |
-
#: custom-field-template/custom-field-template.php:
|
77 |
msgid "Caution:"
|
78 |
msgstr "ご注意:"
|
79 |
|
80 |
-
#: custom-field-template/custom-field-template.php:
|
81 |
msgid "You need to edit `wp-admin/includes/media.php`. Delete or comment out the code in the function media_send_to_editor."
|
82 |
msgstr "`wp-admin/includes/media.php`を編集する必要があります。media_send_to_editor関数の中身を削除するかコメントアウトしてください。"
|
83 |
|
84 |
-
#: custom-field-template/custom-field-template.php:
|
85 |
msgid "In case that you would like to replace custom keys by labels if `label` is set"
|
86 |
msgstr "`label`がセットされていて、カスタムフィールドのキーの代わりにラベルを表示したい場合"
|
87 |
|
88 |
-
#: custom-field-template/custom-field-template.php:
|
89 |
msgid "Use labels in place of custom keys"
|
90 |
msgstr "カスタムフィールドのキーの代わりにラベルを使用する"
|
91 |
|
92 |
-
#: custom-field-template/custom-field-template.php:
|
93 |
msgid "In case that you would like to add p and br tags in textareas automatically"
|
94 |
msgstr "テキストエリアでpタグ、brタグを自動的に追加したい場合"
|
95 |
|
96 |
-
#: custom-field-template/custom-field-template.php:
|
97 |
msgid "Use wpautop function"
|
98 |
msgstr "wpautop関数を使用する"
|
99 |
|
100 |
-
#: custom-field-template/custom-field-template.php:
|
101 |
-
#: custom-field-template/custom-field-template.php:
|
102 |
-
#: custom-field-template/custom-field-template.php:
|
|
|
103 |
msgid "Update Options »"
|
104 |
msgstr "オプションを更新する »"
|
105 |
|
106 |
-
#: custom-field-template/custom-field-template.php:
|
107 |
-
#: custom-field-template/custom-field-template.php:
|
108 |
-
#: custom-field-template/custom-field-template.php:
|
109 |
-
#: custom-field-template/custom-field-template.php:
|
110 |
-
#: custom-field-template/custom-field-template.php:
|
|
|
111 |
msgid "Click to toggle"
|
112 |
msgstr "クリックで切替"
|
113 |
|
114 |
-
#: custom-field-template/custom-field-template.php:
|
115 |
msgid "CSS"
|
116 |
msgstr "CSS"
|
117 |
|
118 |
-
#: custom-field-template/custom-field-template.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
msgid "PHP CODE (Experimental Option)"
|
120 |
msgstr "PHP CODE (Experimental Option)"
|
121 |
|
122 |
-
#: custom-field-template/custom-field-template.php:
|
123 |
msgid "Are you sure to save PHP codes? Please do it at your own risk."
|
124 |
msgstr "PHPコードを保存してよろしいですか?自己責任で実行してください。"
|
125 |
|
126 |
-
#: custom-field-template/custom-field-template.php:
|
127 |
msgid "This option is available only for `radio` and `select` types. You must set $values as an array."
|
128 |
msgstr "このオプションは`radio`と`select`のtypeで有効です。配列として$valuesをセットしなければいけません。"
|
129 |
|
130 |
-
#: custom-field-template/custom-field-template.php:
|
131 |
msgid "Option List"
|
132 |
msgstr "オプションリスト"
|
133 |
|
134 |
-
#: custom-field-template/custom-field-template.php:
|
135 |
msgid "Reset Options"
|
136 |
msgstr "オプションをリセットする"
|
137 |
|
138 |
-
#: custom-field-template/custom-field-template.php:
|
139 |
msgid "Are you sure to reset options? Options you set will be reset to the default settings."
|
140 |
msgstr "本当にオプションをリセットしてもよろしいですか?設定したオプションはデフォルトの状態に戻ります。"
|
141 |
|
142 |
-
#: custom-field-template/custom-field-template.php:
|
143 |
msgid "Unset Options »"
|
144 |
msgstr "オプションをリセットする »"
|
145 |
|
146 |
-
#: custom-field-template/custom-field-template.php:
|
147 |
msgid "Delete Options"
|
148 |
msgstr "オプションを削除する"
|
149 |
|
150 |
-
#: custom-field-template/custom-field-template.php:
|
151 |
msgid "Are you sure to delete options? Options you set will be deleted."
|
152 |
msgstr "本当にオプションを削除してもよろしいですか?設定したオプションは削除されます。"
|
153 |
|
154 |
-
#: custom-field-template/custom-field-template.php:
|
155 |
msgid "Delete Options »"
|
156 |
msgstr "オプションを削除する »"
|
157 |
|
158 |
-
#: custom-field-template/custom-field-template.php:
|
159 |
msgid "Clear"
|
160 |
msgstr "解除"
|
161 |
|
162 |
-
#: custom-field-template/custom-field-template.php:
|
163 |
msgid "Add Media"
|
164 |
msgstr ""
|
165 |
|
166 |
-
#: custom-field-template/custom-field-template.php:
|
167 |
msgid "Add an Image"
|
168 |
msgstr ""
|
169 |
|
170 |
-
#: custom-field-template/custom-field-template.php:
|
171 |
msgid "Add Video"
|
172 |
msgstr ""
|
173 |
|
174 |
-
#: custom-field-template/custom-field-template.php:
|
175 |
msgid "Add Audio"
|
176 |
msgstr ""
|
177 |
|
178 |
-
#: custom-field-template/custom-field-template.php:
|
179 |
msgid "Toggle"
|
180 |
msgstr "切り替え"
|
181 |
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: Custom Field Template\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2009-01-09 21:06+0900\n"
|
6 |
+
"PO-Revision-Date: 2009-01-09 21:07+0900\n"
|
7 |
"Last-Translator: \n"
|
8 |
"Language-Team: \n"
|
9 |
"MIME-Version: 1.0\n"
|
18 |
|
19 |
#: custom-field-template/custom-field-template.php:83
|
20 |
#: custom-field-template/custom-field-template.php:84
|
21 |
+
#: custom-field-template/custom-field-template.php:178
|
22 |
+
#: custom-field-template/custom-field-template.php:235
|
23 |
+
#: custom-field-template/custom-field-template.php:824
|
24 |
msgid "Custom Field Template"
|
25 |
msgstr "カスタムフィールドテンプレート"
|
26 |
|
32 |
msgid "Default Template"
|
33 |
msgstr "デフォルトテンプレート"
|
34 |
|
35 |
+
#: custom-field-template/custom-field-template.php:198
|
36 |
+
#: custom-field-template/custom-field-template.php:202
|
37 |
+
#: custom-field-template/custom-field-template.php:210
|
38 |
+
#: custom-field-template/custom-field-template.php:218
|
39 |
msgid "Options updated."
|
40 |
msgstr "オプションは更新されました。"
|
41 |
|
42 |
+
#: custom-field-template/custom-field-template.php:223
|
43 |
msgid "Options resetted."
|
44 |
msgstr "オプションはリセットされました。"
|
45 |
|
46 |
+
#: custom-field-template/custom-field-template.php:227
|
47 |
msgid "Options deleted."
|
48 |
msgstr "オプションは削除されました。"
|
49 |
|
50 |
+
#: custom-field-template/custom-field-template.php:241
|
51 |
msgid "Custom Field Template Options"
|
52 |
msgstr "カスタムフィールドテンプレートオプション"
|
53 |
|
54 |
+
#: custom-field-template/custom-field-template.php:251
|
55 |
#, php-format
|
56 |
msgid "Template Title %d"
|
57 |
msgstr "テンプレートタイトル %d"
|
58 |
|
59 |
+
#: custom-field-template/custom-field-template.php:253
|
60 |
#, php-format
|
61 |
msgid "Template Instruction %d"
|
62 |
msgstr "テンプレートインストラクション %d"
|
63 |
|
64 |
+
#: custom-field-template/custom-field-template.php:255
|
65 |
#, php-format
|
66 |
msgid "Template Content %d"
|
67 |
msgstr "テンプレートコンテンツ %d"
|
68 |
|
69 |
+
#: custom-field-template/custom-field-template.php:262
|
70 |
msgid "In case that you would like to insert multiple images at once in use of the custom field media buttons"
|
71 |
msgstr "カスタムフィールへの画像挿入を一度に複数枚実行する場合"
|
72 |
|
73 |
+
#: custom-field-template/custom-field-template.php:263
|
74 |
msgid "Use multiple image inset"
|
75 |
msgstr "複数画像挿入を利用する"
|
76 |
|
77 |
+
#: custom-field-template/custom-field-template.php:263
|
78 |
msgid "Caution:"
|
79 |
msgstr "ご注意:"
|
80 |
|
81 |
+
#: custom-field-template/custom-field-template.php:263
|
82 |
msgid "You need to edit `wp-admin/includes/media.php`. Delete or comment out the code in the function media_send_to_editor."
|
83 |
msgstr "`wp-admin/includes/media.php`を編集する必要があります。media_send_to_editor関数の中身を削除するかコメントアウトしてください。"
|
84 |
|
85 |
+
#: custom-field-template/custom-field-template.php:267
|
86 |
msgid "In case that you would like to replace custom keys by labels if `label` is set"
|
87 |
msgstr "`label`がセットされていて、カスタムフィールドのキーの代わりにラベルを表示したい場合"
|
88 |
|
89 |
+
#: custom-field-template/custom-field-template.php:268
|
90 |
msgid "Use labels in place of custom keys"
|
91 |
msgstr "カスタムフィールドのキーの代わりにラベルを使用する"
|
92 |
|
93 |
+
#: custom-field-template/custom-field-template.php:271
|
94 |
msgid "In case that you would like to add p and br tags in textareas automatically"
|
95 |
msgstr "テキストエリアでpタグ、brタグを自動的に追加したい場合"
|
96 |
|
97 |
+
#: custom-field-template/custom-field-template.php:272
|
98 |
msgid "Use wpautop function"
|
99 |
msgstr "wpautop関数を使用する"
|
100 |
|
101 |
+
#: custom-field-template/custom-field-template.php:276
|
102 |
+
#: custom-field-template/custom-field-template.php:295
|
103 |
+
#: custom-field-template/custom-field-template.php:322
|
104 |
+
#: custom-field-template/custom-field-template.php:350
|
105 |
msgid "Update Options »"
|
106 |
msgstr "オプションを更新する »"
|
107 |
|
108 |
+
#: custom-field-template/custom-field-template.php:285
|
109 |
+
#: custom-field-template/custom-field-template.php:304
|
110 |
+
#: custom-field-template/custom-field-template.php:331
|
111 |
+
#: custom-field-template/custom-field-template.php:359
|
112 |
+
#: custom-field-template/custom-field-template.php:431
|
113 |
+
#: custom-field-template/custom-field-template.php:447
|
114 |
msgid "Click to toggle"
|
115 |
msgstr "クリックで切替"
|
116 |
|
117 |
+
#: custom-field-template/custom-field-template.php:286
|
118 |
msgid "CSS"
|
119 |
msgstr "CSS"
|
120 |
|
121 |
+
#: custom-field-template/custom-field-template.php:305
|
122 |
+
msgid "[cft] Shortcode Format"
|
123 |
+
msgstr "[cft] Shortcode Format"
|
124 |
+
|
125 |
+
#: custom-field-template/custom-field-template.php:308
|
126 |
+
msgid "[key] will be converted into the value of [key]."
|
127 |
+
msgstr "[key]は、[key]の値に置換されます。"
|
128 |
+
|
129 |
+
#: custom-field-template/custom-field-template.php:332
|
130 |
msgid "PHP CODE (Experimental Option)"
|
131 |
msgstr "PHP CODE (Experimental Option)"
|
132 |
|
133 |
+
#: custom-field-template/custom-field-template.php:334
|
134 |
msgid "Are you sure to save PHP codes? Please do it at your own risk."
|
135 |
msgstr "PHPコードを保存してよろしいですか?自己責任で実行してください。"
|
136 |
|
137 |
+
#: custom-field-template/custom-field-template.php:335
|
138 |
msgid "This option is available only for `radio` and `select` types. You must set $values as an array."
|
139 |
msgstr "このオプションは`radio`と`select`のtypeで有効です。配列として$valuesをセットしなければいけません。"
|
140 |
|
141 |
+
#: custom-field-template/custom-field-template.php:360
|
142 |
msgid "Option List"
|
143 |
msgstr "オプションリスト"
|
144 |
|
145 |
+
#: custom-field-template/custom-field-template.php:432
|
146 |
msgid "Reset Options"
|
147 |
msgstr "オプションをリセットする"
|
148 |
|
149 |
+
#: custom-field-template/custom-field-template.php:434
|
150 |
msgid "Are you sure to reset options? Options you set will be reset to the default settings."
|
151 |
msgstr "本当にオプションをリセットしてもよろしいですか?設定したオプションはデフォルトの状態に戻ります。"
|
152 |
|
153 |
+
#: custom-field-template/custom-field-template.php:438
|
154 |
msgid "Unset Options »"
|
155 |
msgstr "オプションをリセットする »"
|
156 |
|
157 |
+
#: custom-field-template/custom-field-template.php:448
|
158 |
msgid "Delete Options"
|
159 |
msgstr "オプションを削除する"
|
160 |
|
161 |
+
#: custom-field-template/custom-field-template.php:450
|
162 |
msgid "Are you sure to delete options? Options you set will be deleted."
|
163 |
msgstr "本当にオプションを削除してもよろしいですか?設定したオプションは削除されます。"
|
164 |
|
165 |
+
#: custom-field-template/custom-field-template.php:454
|
166 |
msgid "Delete Options »"
|
167 |
msgstr "オプションを削除する »"
|
168 |
|
169 |
+
#: custom-field-template/custom-field-template.php:597
|
170 |
msgid "Clear"
|
171 |
msgstr "解除"
|
172 |
|
173 |
+
#: custom-field-template/custom-field-template.php:712
|
174 |
msgid "Add Media"
|
175 |
msgstr ""
|
176 |
|
177 |
+
#: custom-field-template/custom-field-template.php:714
|
178 |
msgid "Add an Image"
|
179 |
msgstr ""
|
180 |
|
181 |
+
#: custom-field-template/custom-field-template.php:716
|
182 |
msgid "Add Video"
|
183 |
msgstr ""
|
184 |
|
185 |
+
#: custom-field-template/custom-field-template.php:718
|
186 |
msgid "Add Audio"
|
187 |
msgstr ""
|
188 |
|
189 |
+
#: custom-field-template/custom-field-template.php:729
|
190 |
msgid "Toggle"
|
191 |
msgstr "切り替え"
|
192 |
|
custom-field-template-ru_RU.mo
ADDED
Binary file
|
custom-field-template-ru_RU.po
ADDED
@@ -0,0 +1,184 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: Custom Field Template 0.7.4\n"
|
4 |
+
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2008-12-26 17:40+0300\n"
|
6 |
+
"PO-Revision-Date: \n"
|
7 |
+
"Last-Translator: Sonika <sonika@sonika.ru>\n"
|
8 |
+
"Language-Team: sonika.ru <sonika@sonika.ru>\n"
|
9 |
+
"MIME-Version: 1.0\n"
|
10 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
+
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"X-Poedit-Language: Russian\n"
|
13 |
+
"X-Poedit-Country: RUSSIAN FEDERATION\n"
|
14 |
+
"X-Poedit-KeywordsList: __;_e\n"
|
15 |
+
"X-Poedit-Basepath: ../\n"
|
16 |
+
"X-Poedit-SourceCharset: utf-8\n"
|
17 |
+
"X-Poedit-SearchPath-0: custom-field-template\n"
|
18 |
+
|
19 |
+
#: custom-field-template/custom-field-template.php:83
|
20 |
+
#: custom-field-template/custom-field-template.php:84
|
21 |
+
#: custom-field-template/custom-field-template.php:161
|
22 |
+
#: custom-field-template/custom-field-template.php:210
|
23 |
+
#: custom-field-template/custom-field-template.php:741
|
24 |
+
msgid "Custom Field Template"
|
25 |
+
msgstr "Шаблоны custom field"
|
26 |
+
|
27 |
+
#: custom-field-template/custom-field-template.php:95
|
28 |
+
msgid "Settings"
|
29 |
+
msgstr "Настройки"
|
30 |
+
|
31 |
+
#: custom-field-template/custom-field-template.php:106
|
32 |
+
msgid "Default Template"
|
33 |
+
msgstr "Пример шаблона"
|
34 |
+
|
35 |
+
#: custom-field-template/custom-field-template.php:181
|
36 |
+
#: custom-field-template/custom-field-template.php:185
|
37 |
+
#: custom-field-template/custom-field-template.php:193
|
38 |
+
msgid "Options updated."
|
39 |
+
msgstr "Настройки обновлены."
|
40 |
+
|
41 |
+
#: custom-field-template/custom-field-template.php:198
|
42 |
+
msgid "Options resetted."
|
43 |
+
msgstr "Настройки сброшены."
|
44 |
+
|
45 |
+
#: custom-field-template/custom-field-template.php:202
|
46 |
+
msgid "Options deleted."
|
47 |
+
msgstr "Настройки удалены."
|
48 |
+
|
49 |
+
#: custom-field-template/custom-field-template.php:216
|
50 |
+
msgid "Custom Field Template Options"
|
51 |
+
msgstr "Настройки Custom Field Template"
|
52 |
+
|
53 |
+
#: custom-field-template/custom-field-template.php:226
|
54 |
+
#, php-format
|
55 |
+
msgid "Template Title %d"
|
56 |
+
msgstr "Название шаблона %d"
|
57 |
+
|
58 |
+
#: custom-field-template/custom-field-template.php:228
|
59 |
+
#, php-format
|
60 |
+
msgid "Template Instruction %d"
|
61 |
+
msgstr "Инструкция к шаблону %d"
|
62 |
+
|
63 |
+
#: custom-field-template/custom-field-template.php:230
|
64 |
+
#, php-format
|
65 |
+
msgid "Template Content %d"
|
66 |
+
msgstr "Содержимое шаблона %d"
|
67 |
+
|
68 |
+
#: custom-field-template/custom-field-template.php:237
|
69 |
+
msgid "In case that you would like to insert multiple images at once in use of the custom field media buttons"
|
70 |
+
msgstr "Если вы хотите вставлять несколько изображений за один раз"
|
71 |
+
|
72 |
+
#: custom-field-template/custom-field-template.php:238
|
73 |
+
msgid "Use multiple image inset"
|
74 |
+
msgstr "да"
|
75 |
+
|
76 |
+
#: custom-field-template/custom-field-template.php:238
|
77 |
+
msgid "Caution:"
|
78 |
+
msgstr "Предупреждение:"
|
79 |
+
|
80 |
+
#: custom-field-template/custom-field-template.php:238
|
81 |
+
msgid "You need to edit `wp-admin/includes/media.php`. Delete or comment out the code in the function media_send_to_editor."
|
82 |
+
msgstr "вам нужно отредактировать файл <code>wp-admin/includes/media.php</code>, удалите или закомментируйте код в функции media_send_to_editor."
|
83 |
+
|
84 |
+
#: custom-field-template/custom-field-template.php:242
|
85 |
+
msgid "In case that you would like to replace custom keys by labels if `label` is set"
|
86 |
+
msgstr "Показывать ярлык (label) вместо ключа произвольного поля (если label указан)"
|
87 |
+
|
88 |
+
#: custom-field-template/custom-field-template.php:243
|
89 |
+
msgid "Use labels in place of custom keys"
|
90 |
+
msgstr "использовать ярлыки"
|
91 |
+
|
92 |
+
#: custom-field-template/custom-field-template.php:246
|
93 |
+
msgid "In case that you would like to add p and br tags in textareas automatically"
|
94 |
+
msgstr "Добавлять теги p и br в текстовое поле автоматически"
|
95 |
+
|
96 |
+
#: custom-field-template/custom-field-template.php:247
|
97 |
+
msgid "Use wpautop function"
|
98 |
+
msgstr "Использовать функцию wpautop"
|
99 |
+
|
100 |
+
#: custom-field-template/custom-field-template.php:251
|
101 |
+
#: custom-field-template/custom-field-template.php:270
|
102 |
+
#: custom-field-template/custom-field-template.php:298
|
103 |
+
msgid "Update Options »"
|
104 |
+
msgstr "Обновить настройки »"
|
105 |
+
|
106 |
+
#: custom-field-template/custom-field-template.php:260
|
107 |
+
#: custom-field-template/custom-field-template.php:279
|
108 |
+
#: custom-field-template/custom-field-template.php:307
|
109 |
+
#: custom-field-template/custom-field-template.php:372
|
110 |
+
#: custom-field-template/custom-field-template.php:388
|
111 |
+
msgid "Click to toggle"
|
112 |
+
msgstr "Свернуть"
|
113 |
+
|
114 |
+
#: custom-field-template/custom-field-template.php:261
|
115 |
+
msgid "CSS"
|
116 |
+
msgstr ""
|
117 |
+
|
118 |
+
#: custom-field-template/custom-field-template.php:280
|
119 |
+
msgid "PHP CODE (Experimental Option)"
|
120 |
+
msgstr "PHP код (экспериментальная опция)"
|
121 |
+
|
122 |
+
#: custom-field-template/custom-field-template.php:282
|
123 |
+
msgid "Are you sure to save PHP codes? Please do it at your own risk."
|
124 |
+
msgstr "Сохраняем PHP код? Т.к. это экспериментальная функция, то вы делаете это на свой страх и риск."
|
125 |
+
|
126 |
+
#: custom-field-template/custom-field-template.php:283
|
127 |
+
msgid "This option is available only for `radio` and `select` types. You must set $values as an array."
|
128 |
+
msgstr "Это опция только для типов полей `radio` и `select`. Вы должны задать $values как массив."
|
129 |
+
|
130 |
+
#: custom-field-template/custom-field-template.php:308
|
131 |
+
msgid "Option List"
|
132 |
+
msgstr "Список настроек"
|
133 |
+
|
134 |
+
#: custom-field-template/custom-field-template.php:373
|
135 |
+
msgid "Reset Options"
|
136 |
+
msgstr "Сбросить настройки"
|
137 |
+
|
138 |
+
#: custom-field-template/custom-field-template.php:375
|
139 |
+
msgid "Are you sure to reset options? Options you set will be reset to the default settings."
|
140 |
+
msgstr "Сбрасываем настройки? Все настройки будут сброшены к дефолтным, созданные шаблоны не сохранятся."
|
141 |
+
|
142 |
+
#: custom-field-template/custom-field-template.php:379
|
143 |
+
msgid "Unset Options »"
|
144 |
+
msgstr "Сбросить настройки »"
|
145 |
+
|
146 |
+
#: custom-field-template/custom-field-template.php:389
|
147 |
+
msgid "Delete Options"
|
148 |
+
msgstr "Удалить настройки"
|
149 |
+
|
150 |
+
#: custom-field-template/custom-field-template.php:391
|
151 |
+
msgid "Are you sure to delete options? Options you set will be deleted."
|
152 |
+
msgstr "Удаляем настройки? Удалятся ВСЕ настройки и шаблоны."
|
153 |
+
|
154 |
+
#: custom-field-template/custom-field-template.php:395
|
155 |
+
msgid "Delete Options »"
|
156 |
+
msgstr "Удалить настройки »"
|
157 |
+
|
158 |
+
#: custom-field-template/custom-field-template.php:533
|
159 |
+
msgid "Clear"
|
160 |
+
msgstr "очистить"
|
161 |
+
|
162 |
+
#: custom-field-template/custom-field-template.php:634
|
163 |
+
msgid "Add Media"
|
164 |
+
msgstr "добавить медиа-файл"
|
165 |
+
|
166 |
+
#: custom-field-template/custom-field-template.php:636
|
167 |
+
msgid "Add an Image"
|
168 |
+
msgstr "добавить изображение"
|
169 |
+
|
170 |
+
#: custom-field-template/custom-field-template.php:638
|
171 |
+
msgid "Add Video"
|
172 |
+
msgstr "добавить видео-файл"
|
173 |
+
|
174 |
+
#: custom-field-template/custom-field-template.php:640
|
175 |
+
msgid "Add Audio"
|
176 |
+
msgstr "добавить аудио-файл"
|
177 |
+
|
178 |
+
#: custom-field-template/custom-field-template.php:651
|
179 |
+
msgid "Toggle"
|
180 |
+
msgstr "Переключатель"
|
181 |
+
|
182 |
+
#~ msgid "Admin CSS"
|
183 |
+
#~ msgstr "CSS шаблона в админ. панели"
|
184 |
+
|
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.
|
8 |
Author URI: http://wordpressgogo.com/
|
9 |
*/
|
10 |
|
@@ -25,12 +25,12 @@ class custom_field_template {
|
|
25 |
add_action( 'publish_post', array(&$this, 'edit_meta_value'), 100 );
|
26 |
|
27 |
add_filter( 'media_send_to_editor', array(&$this, 'media_send_to_custom_field'), 15 );
|
28 |
-
add_filter( 'plugin_action_links', array(&$this, 'wpaq_filter_plugin_actions'
|
29 |
|
30 |
if ( function_exists('add_shortcode') )
|
31 |
add_shortcode( 'cft', array(&$this, 'output_custom_field_values') );
|
32 |
}
|
33 |
-
|
34 |
function media_send_to_custom_field($html) {
|
35 |
$options = $this->get_custom_field_template_data();
|
36 |
|
@@ -136,6 +136,23 @@ rows = 4
|
|
136 |
cols = 40
|
137 |
tinyMCE = true
|
138 |
mediaButton = true';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
update_option('custom_field_template_data', $options);
|
140 |
}
|
141 |
|
@@ -183,6 +200,14 @@ mediaButton = true';
|
|
183 |
$options['css'] = $_POST['custom_field_template_css'];
|
184 |
update_option('custom_field_template_data', $options);
|
185 |
$message = __('Options updated.', 'custom-field-template');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
186 |
elseif ($_POST['custom_field_template_php_submit']) :
|
187 |
unset($options['php']);
|
188 |
for($i=0;$i<count($_POST["custom_field_template_php"]);$i++) {
|
@@ -257,7 +282,7 @@ mediaButton = true';
|
|
257 |
</div>
|
258 |
|
259 |
<div class="postbox closed">
|
260 |
-
<div class="handlediv" title="<?php _e('Click to toggle', '
|
261 |
<h3><?php _e('CSS', 'custom-field-template'); ?></h3>
|
262 |
<div class="inside">
|
263 |
<form method="post">
|
@@ -275,6 +300,33 @@ mediaButton = true';
|
|
275 |
</div>
|
276 |
</div>
|
277 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
278 |
<div class="postbox closed">
|
279 |
<div class="handlediv" title="<?php _e('Click to toggle', 'meta-ext'); ?>"><br /></div>
|
280 |
<h3><?php _e('PHP CODE (Experimental Option)', 'custom-field-template'); ?></h3>
|
@@ -304,7 +356,7 @@ ex. `checkbox`:<br />$values = array('dog', 'cat', 'monkey'); $defaults = array(
|
|
304 |
</div>
|
305 |
|
306 |
<div class="postbox closed">
|
307 |
-
<div class="handlediv" title="<?php _e('Click to toggle', '
|
308 |
<h3><?php _e('Option List', 'custom-field-template'); ?></h3>
|
309 |
<div class="inside">
|
310 |
ex.<br />
|
@@ -334,7 +386,11 @@ hideKey = true<br />
|
|
334 |
<td></td>
|
335 |
</tr>
|
336 |
<tr>
|
337 |
-
<th>
|
|
|
|
|
|
|
|
|
338 |
</tr>
|
339 |
<tr>
|
340 |
<th>clearButton</th><td></td><td></td><td>clearButton = true</td><td></td><td></td>
|
@@ -363,13 +419,16 @@ hideKey = true<br />
|
|
363 |
<tr>
|
364 |
<th>output</th><td>output = true</td><td>output = true</td><td>output = true</td><td>output = true</td><td>output = true</td>
|
365 |
</tr>
|
|
|
|
|
|
|
366 |
</tbody>
|
367 |
</table>
|
368 |
</div>
|
369 |
</div>
|
370 |
|
371 |
<div class="postbox closed">
|
372 |
-
<div class="handlediv" title="<?php _e('Click to toggle', '
|
373 |
<h3><?php _e('Reset Options', 'custom-field-template'); ?></h3>
|
374 |
<div class="inside">
|
375 |
<form method="post" onsubmit="return confirm('<?php _e('Are you sure to reset options? Options you set will be reset to the default settings.', 'custom-field-template'); ?>');">
|
@@ -385,7 +444,7 @@ hideKey = true<br />
|
|
385 |
</div>
|
386 |
|
387 |
<div class="postbox closed">
|
388 |
-
<div class="handlediv" title="<?php _e('Click to toggle', '
|
389 |
<h3><?php _e('Delete Options', 'custom-field-template'); ?></h3>
|
390 |
<div class="inside">
|
391 |
<form method="post" onsubmit="return confirm('<?php _e('Are you sure to delete options? Options you set will be deleted.', 'custom-field-template'); ?>');">
|
@@ -434,7 +493,7 @@ jQuery(this).addClass("closed");
|
|
434 |
return $custom_fields;
|
435 |
}
|
436 |
|
437 |
-
function make_textfield( $name, $sid, $size = 25, $hideKey, $label ) {
|
438 |
$options = $this->get_custom_field_template_data();
|
439 |
|
440 |
$title = $name;
|
@@ -445,6 +504,8 @@ jQuery(this).addClass("closed");
|
|
445 |
if ( $value ) {
|
446 |
$value = $value[ $sid ];
|
447 |
}
|
|
|
|
|
448 |
}
|
449 |
|
450 |
if ( $hideKey == true ) $hide = ' class="hideKey"';
|
@@ -464,7 +525,7 @@ jQuery(this).addClass("closed");
|
|
464 |
return $out;
|
465 |
}
|
466 |
|
467 |
-
function make_checkbox( $name, $sid, $value, $checked, $hideKey, $label, $code ) {
|
468 |
$options = $this->get_custom_field_template_data();
|
469 |
|
470 |
$title = $name;
|
@@ -477,8 +538,7 @@ jQuery(this).addClass("closed");
|
|
477 |
if ( $selected ) {
|
478 |
if ( in_array(stripcslashes($value), $selected) ) $checked = 'checked="checked"';
|
479 |
}
|
480 |
-
}
|
481 |
-
else {
|
482 |
if( $checked == true ) $checked = 'checked="checked"';
|
483 |
}
|
484 |
|
@@ -494,14 +554,19 @@ jQuery(this).addClass("closed");
|
|
494 |
|
495 |
if ( !empty($label) && !$options['custom_field_template_replace_keys_by_labels'] )
|
496 |
$out .= '<p class="label">' . stripcslashes($label) . '</p>';
|
497 |
-
$out .= '<label for="' . $id . '" class="selectit"><input name="' . $name . '[' . $sid . ']" value="' . attribute_escape($value) . '" ' . $checked . ' type="checkbox" /> '
|
|
|
|
|
|
|
|
|
|
|
498 |
|
499 |
$out .= '</dd></dl>';
|
500 |
|
501 |
return $out;
|
502 |
}
|
503 |
|
504 |
-
function make_radio( $name, $sid, $values, $clearButton, $default, $hideKey, $label, $code ) {
|
505 |
$options = $this->get_custom_field_template_data();
|
506 |
|
507 |
$title = $name;
|
@@ -514,8 +579,7 @@ jQuery(this).addClass("closed");
|
|
514 |
if( isset( $_REQUEST[ 'post' ] ) && $_REQUEST[ 'post' ] > 0 ) {
|
515 |
$selected = get_post_meta( $_REQUEST[ 'post' ], $title );
|
516 |
$selected = $selected[ $sid ];
|
517 |
-
}
|
518 |
-
else {
|
519 |
$selected = $default;
|
520 |
}
|
521 |
|
@@ -540,20 +604,27 @@ jQuery(this).addClass("closed");
|
|
540 |
|
541 |
if ( !empty($label) && !$options['custom_field_template_replace_keys_by_labels'] )
|
542 |
$out .= '<p class="label">' . stripcslashes($label) . '</p>';
|
|
|
543 |
foreach( $values as $val ) {
|
544 |
$id = $name . '_' . $this->sanitize_name( $val );
|
545 |
|
546 |
$checked = ( trim( $val ) == trim( $selected ) ) ? 'checked="checked"' : '';
|
547 |
|
548 |
$out .=
|
549 |
-
'<label for="' . $id . '" class="selectit"><input id="' . $id . '" name="' . $name . '[' . $sid . ']" value="' . attribute_escape($val) . '" ' . $checked . ' type="radio" /> '
|
|
|
|
|
|
|
|
|
|
|
|
|
550 |
}
|
551 |
$out .= '</dd></dl>';
|
552 |
|
553 |
return $out;
|
554 |
}
|
555 |
|
556 |
-
function make_select( $name, $sid, $values, $default, $hideKey, $label, $code ) {
|
557 |
$options = $this->get_custom_field_template_data();
|
558 |
|
559 |
$title = $name;
|
@@ -568,8 +639,7 @@ jQuery(this).addClass("closed");
|
|
568 |
if ( $selected ) {
|
569 |
$selected = $selected[ $sid ];
|
570 |
}
|
571 |
-
}
|
572 |
-
else {
|
573 |
$selected = $default;
|
574 |
}
|
575 |
|
@@ -587,19 +657,25 @@ jQuery(this).addClass("closed");
|
|
587 |
$out .= '<p class="label">' . stripcslashes($label) . '</p>';
|
588 |
$out .= '<select name="' . $name . '[]">' .
|
589 |
'<option value="" >Select</option>';
|
590 |
-
|
|
|
591 |
foreach( $values as $val ) {
|
592 |
$checked = ( trim( $val ) == trim( $selected ) ) ? 'selected="selected"' : '';
|
593 |
|
594 |
-
$out .=
|
595 |
-
|
|
|
|
|
|
|
|
|
|
|
596 |
}
|
597 |
$out .= '</select></dd></dl>';
|
598 |
|
599 |
return $out;
|
600 |
}
|
601 |
|
602 |
-
function make_textarea( $name, $sid, $rows, $cols, $tinyMCE, $mediaButton, $hideKey, $label ) {
|
603 |
$options = $this->get_custom_field_template_data();
|
604 |
|
605 |
global $wp_version;
|
@@ -610,6 +686,8 @@ jQuery(this).addClass("closed");
|
|
610 |
if( isset( $_REQUEST[ 'post' ] ) ) {
|
611 |
$value = get_post_meta( $_REQUEST[ 'post' ], $title );
|
612 |
$value = $value[ $sid ];
|
|
|
|
|
613 |
}
|
614 |
|
615 |
$rand = rand();
|
@@ -686,37 +764,42 @@ EOF;
|
|
686 |
if ( $options['custom_fields'][$id]['instruction'] )
|
687 |
$out .= '<div id="cft_instruction">' . stripcslashes($options['custom_fields'][$id]['instruction']) . '</div>';
|
688 |
|
|
|
689 |
$out .= '<input type="hidden" name="custom-field-template-id" id="custom-field-template-id" value="' . $id . '" />';
|
690 |
foreach( $fields as $title => $data ) {
|
691 |
for($i = 0; $i<count($data); $i++) {
|
692 |
if ( is_numeric($data[$i]['level']) ) :
|
693 |
if ( $data[$i]['level'] > $level ) continue;
|
694 |
-
endif;
|
695 |
-
if( $data[$i]['type'] == '
|
696 |
-
$out .=
|
|
|
|
|
|
|
697 |
}
|
698 |
else if( $data[$i]['type'] == 'checkbox' ) {
|
699 |
$out .=
|
700 |
-
$this->make_checkbox( $title, $i, $data[$i]['value'], $data[$i]['checked'], $data[$i]['hideKey'], $data[$i]['label'], $data[$i]['code'] );
|
701 |
}
|
702 |
else if( $data[$i]['type'] == 'radio' ) {
|
703 |
$out .=
|
704 |
$this->make_radio(
|
705 |
-
$title, $i, explode( '#', $data[$i]['value'] ), $data[$i]['clearButton'], $data[$i]['default'], $data[$i]['hideKey'], $data[$i]['label'], $data[$i]['code'] );
|
706 |
}
|
707 |
else if( $data[$i]['type'] == 'select' ) {
|
708 |
$out .=
|
709 |
$this->make_select(
|
710 |
-
$title, $i, explode( '#', $data[$i]['value'] ), $data[$i]['default'], $data[$i]['hideKey'], $data[$i]['label'], $data[$i]['code'] );
|
711 |
}
|
712 |
else if( $data[$i]['type'] == 'textarea' ) {
|
713 |
if ( $options['tinyMCE'][$_REQUEST['post']][$this->sanitize_name($title)][$i] ) $data[$i]['rows'] = $options['tinyMCE'][$_REQUEST['post']][$this->sanitize_name($title)][$i];
|
714 |
$out .=
|
715 |
-
$this->make_textarea( $title, $i, $data[$i]['rows'], $data[$i]['cols'], $data[$i]['tinyMCE'], $data[$i]['mediaButton'], $data[$i]['hideKey'], $data[$i]['label'] );
|
716 |
}
|
717 |
}
|
718 |
}
|
719 |
-
$out .= '
|
|
|
720 |
|
721 |
return $out;
|
722 |
}
|
@@ -911,7 +994,8 @@ jQuery("#edButtonPreview").trigger("click"); }' . "\n";
|
|
911 |
preg_match('/cw=[0-9]+&ch=([0-9]+)/', $_REQUEST['TinyMCE_' . $name . trim($_REQUEST[ $name."_rand" ][$i]) . '_size'], $matched);
|
912 |
$options['tinyMCE'][$id][$name][$i] = (int)($matched[1]/20);
|
913 |
}
|
914 |
-
}
|
|
|
915 |
}
|
916 |
}
|
917 |
|
@@ -984,6 +1068,7 @@ jQuery("#edButtonPreview").trigger("click"); }' . "\n";
|
|
984 |
eval(stripcslashes($options['php'][$val["code"]]));
|
985 |
else :
|
986 |
$values = explode( '#', $val["value"] );
|
|
|
987 |
$defaults = explode( '#', $val["default"] );
|
988 |
endif;
|
989 |
|
@@ -993,9 +1078,12 @@ jQuery("#edButtonPreview").trigger("click"); }' . "\n";
|
|
993 |
|
994 |
$tmp = $key;
|
995 |
if ( is_array($values) ) :
|
|
|
996 |
foreach($values as $value) {
|
997 |
$Data[$title][$key]["type"] = "checkbox";
|
998 |
$Data[$title][$key]["value"] = trim($value);
|
|
|
|
|
999 |
if ( $tmp!=$key )
|
1000 |
$Data[$title][$key]["hideKey"] = true;
|
1001 |
if ( is_array($defaults) )
|
@@ -1008,6 +1096,7 @@ jQuery("#edButtonPreview").trigger("click"); }' . "\n";
|
|
1008 |
if ( $val["output"] == true )
|
1009 |
$Data[$title][$key]["output"] = true;
|
1010 |
$key++;
|
|
|
1011 |
}
|
1012 |
endif;
|
1013 |
}
|
@@ -1023,38 +1112,67 @@ jQuery("#edButtonPreview").trigger("click"); }' . "\n";
|
|
1023 |
|
1024 |
extract(shortcode_atts(array(
|
1025 |
'post_id' => $post->ID,
|
1026 |
-
'template' => 0
|
|
|
1027 |
), $attr));
|
1028 |
|
1029 |
-
$
|
1030 |
-
|
1031 |
-
|
1032 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1033 |
|
1034 |
-
|
1035 |
-
|
1036 |
-
|
1037 |
-
|
1038 |
-
|
1039 |
-
|
1040 |
-
|
1041 |
-
|
1042 |
-
|
1043 |
-
|
1044 |
-
|
1045 |
-
|
1046 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1047 |
endif;
|
1048 |
-
|
1049 |
-
$output .= '<dt><span' . $hide . '>' . $key . '</span></dt>' . "\n";
|
1050 |
-
$output .= '<dd>' . $value[$key2] . '</dd>' . "\n";
|
1051 |
-
endif;
|
1052 |
endif;
|
1053 |
endforeach;
|
1054 |
-
|
1055 |
-
|
1056 |
|
1057 |
-
return $output;
|
1058 |
}
|
1059 |
}
|
1060 |
|
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.8
|
8 |
Author URI: http://wordpressgogo.com/
|
9 |
*/
|
10 |
|
25 |
add_action( 'publish_post', array(&$this, 'edit_meta_value'), 100 );
|
26 |
|
27 |
add_filter( 'media_send_to_editor', array(&$this, 'media_send_to_custom_field'), 15 );
|
28 |
+
add_filter( 'plugin_action_links', array(&$this, 'wpaq_filter_plugin_actions'), 10, 2);
|
29 |
|
30 |
if ( function_exists('add_shortcode') )
|
31 |
add_shortcode( 'cft', array(&$this, 'output_custom_field_values') );
|
32 |
}
|
33 |
+
|
34 |
function media_send_to_custom_field($html) {
|
35 |
$options = $this->get_custom_field_template_data();
|
36 |
|
136 |
cols = 40
|
137 |
tinyMCE = true
|
138 |
mediaButton = true';
|
139 |
+
$options['shortcode_format'][0] = '<table class="cft">
|
140 |
+
<tbody>
|
141 |
+
<tr>
|
142 |
+
<th>Plan</td><td colspan="3">[Plan]</td>
|
143 |
+
</tr>
|
144 |
+
<tr>
|
145 |
+
<th>Favorite Fruits</th><td>[Favorite Fruits]</td>
|
146 |
+
<th>Miles Walked</th><td>[Miles Walked]</td>
|
147 |
+
</tr>
|
148 |
+
<tr>
|
149 |
+
<th>Temper Level</th><td colspan="3">[Temper Level]</td>
|
150 |
+
</tr>
|
151 |
+
<tr>
|
152 |
+
<th>Hidden Thought</th><td colspan="3">[Hidden Thought]</td>
|
153 |
+
</tr>
|
154 |
+
</tbody>
|
155 |
+
</table>';
|
156 |
update_option('custom_field_template_data', $options);
|
157 |
}
|
158 |
|
200 |
$options['css'] = $_POST['custom_field_template_css'];
|
201 |
update_option('custom_field_template_data', $options);
|
202 |
$message = __('Options updated.', 'custom-field-template');
|
203 |
+
elseif ($_POST['custom_field_template_shortcode_format_submit']) :
|
204 |
+
unset($options['shortcode_format']);
|
205 |
+
for($i=0;$i<count($_POST["custom_field_template_shortcode_format"]);$i++) {
|
206 |
+
if( $_POST["custom_field_template_shortcode_format"][$i] )
|
207 |
+
$options['shortcode_format'][] = $_POST["custom_field_template_shortcode_format"][$i];
|
208 |
+
}
|
209 |
+
update_option('custom_field_template_data', $options);
|
210 |
+
$message = __('Options updated.', 'custom-field-template');
|
211 |
elseif ($_POST['custom_field_template_php_submit']) :
|
212 |
unset($options['php']);
|
213 |
for($i=0;$i<count($_POST["custom_field_template_php"]);$i++) {
|
282 |
</div>
|
283 |
|
284 |
<div class="postbox closed">
|
285 |
+
<div class="handlediv" title="<?php _e('Click to toggle', 'custom-field-template'); ?>"><br /></div>
|
286 |
<h3><?php _e('CSS', 'custom-field-template'); ?></h3>
|
287 |
<div class="inside">
|
288 |
<form method="post">
|
300 |
</div>
|
301 |
</div>
|
302 |
|
303 |
+
<div class="postbox closed">
|
304 |
+
<div class="handlediv" title="<?php _e('Click to toggle', 'meta-ext'); ?>"><br /></div>
|
305 |
+
<h3><?php _e('[cft] Shortcode Format', 'custom-field-template'); ?></h3>
|
306 |
+
<div class="inside">
|
307 |
+
<form method="post">
|
308 |
+
<p><?php _e('[key] will be converted into the value of [key].', 'custom-field-template'); ?></p>
|
309 |
+
<table class="form-table" style="margin-bottom:5px;">
|
310 |
+
<tbody>
|
311 |
+
<?php
|
312 |
+
for ($i=0;$i<count($options['shortcode_format'])+1;$i++) :
|
313 |
+
?>
|
314 |
+
<tr><th><strong>FORMAT #<?php echo $i; ?></strong></th></tr>
|
315 |
+
<tr><td>
|
316 |
+
<p><textarea name="custom_field_template_shortcode_format[]" rows="10" cols="60"><?php echo stripcslashes($options['shortcode_format'][$i]); ?></textarea></p>
|
317 |
+
</td></tr>
|
318 |
+
<?php
|
319 |
+
endfor;
|
320 |
+
?>
|
321 |
+
<tr><td>
|
322 |
+
<p><input type="submit" name="custom_field_template_shortcode_format_submit" value="<?php _e('Update Options »', 'custom-field-template'); ?>" class="button-primary" /></p>
|
323 |
+
</td></tr>
|
324 |
+
</tbody>
|
325 |
+
</table>
|
326 |
+
</form>
|
327 |
+
</div>
|
328 |
+
</div>
|
329 |
+
|
330 |
<div class="postbox closed">
|
331 |
<div class="handlediv" title="<?php _e('Click to toggle', 'meta-ext'); ?>"><br /></div>
|
332 |
<h3><?php _e('PHP CODE (Experimental Option)', 'custom-field-template'); ?></h3>
|
356 |
</div>
|
357 |
|
358 |
<div class="postbox closed">
|
359 |
+
<div class="handlediv" title="<?php _e('Click to toggle', 'custom-field-template'); ?>"><br /></div>
|
360 |
<h3><?php _e('Option List', 'custom-field-template'); ?></h3>
|
361 |
<div class="inside">
|
362 |
ex.<br />
|
386 |
<td></td>
|
387 |
</tr>
|
388 |
<tr>
|
389 |
+
<th>valueLabel</th><td></td><td>valueLabel = apples # oranges # bananas</td><td>valueLabel = apples # oranges # bananas</td><td>valueLabel = apples # oranges # bananas</td>
|
390 |
+
<td></td>
|
391 |
+
</tr>
|
392 |
+
<tr>
|
393 |
+
<th>default</th><td>default = orange</td><td>default = orange # banana</td><td>default = orange</td><td>default = orange</td><td>default = orange</td>
|
394 |
</tr>
|
395 |
<tr>
|
396 |
<th>clearButton</th><td></td><td></td><td>clearButton = true</td><td></td><td></td>
|
419 |
<tr>
|
420 |
<th>output</th><td>output = true</td><td>output = true</td><td>output = true</td><td>output = true</td><td>output = true</td>
|
421 |
</tr>
|
422 |
+
<tr>
|
423 |
+
<th>blank</th><td>blank = true</td><td>blank = true</td><td>blank = true</td><td>blank = true</td><td>blank = true</td>
|
424 |
+
</tr>
|
425 |
</tbody>
|
426 |
</table>
|
427 |
</div>
|
428 |
</div>
|
429 |
|
430 |
<div class="postbox closed">
|
431 |
+
<div class="handlediv" title="<?php _e('Click to toggle', 'custom-field-template'); ?>"><br /></div>
|
432 |
<h3><?php _e('Reset Options', 'custom-field-template'); ?></h3>
|
433 |
<div class="inside">
|
434 |
<form method="post" onsubmit="return confirm('<?php _e('Are you sure to reset options? Options you set will be reset to the default settings.', 'custom-field-template'); ?>');">
|
444 |
</div>
|
445 |
|
446 |
<div class="postbox closed">
|
447 |
+
<div class="handlediv" title="<?php _e('Click to toggle', 'custom-field-template'); ?>"><br /></div>
|
448 |
<h3><?php _e('Delete Options', 'custom-field-template'); ?></h3>
|
449 |
<div class="inside">
|
450 |
<form method="post" onsubmit="return confirm('<?php _e('Are you sure to delete options? Options you set will be deleted.', 'custom-field-template'); ?>');">
|
493 |
return $custom_fields;
|
494 |
}
|
495 |
|
496 |
+
function make_textfield( $name, $sid, $size = 25, $default, $hideKey, $label ) {
|
497 |
$options = $this->get_custom_field_template_data();
|
498 |
|
499 |
$title = $name;
|
504 |
if ( $value ) {
|
505 |
$value = $value[ $sid ];
|
506 |
}
|
507 |
+
} else {
|
508 |
+
$value = $default;
|
509 |
}
|
510 |
|
511 |
if ( $hideKey == true ) $hide = ' class="hideKey"';
|
525 |
return $out;
|
526 |
}
|
527 |
|
528 |
+
function make_checkbox( $name, $sid, $value, $valueLabel, $checked, $hideKey, $label, $code ) {
|
529 |
$options = $this->get_custom_field_template_data();
|
530 |
|
531 |
$title = $name;
|
538 |
if ( $selected ) {
|
539 |
if ( in_array(stripcslashes($value), $selected) ) $checked = 'checked="checked"';
|
540 |
}
|
541 |
+
} else {
|
|
|
542 |
if( $checked == true ) $checked = 'checked="checked"';
|
543 |
}
|
544 |
|
554 |
|
555 |
if ( !empty($label) && !$options['custom_field_template_replace_keys_by_labels'] )
|
556 |
$out .= '<p class="label">' . stripcslashes($label) . '</p>';
|
557 |
+
$out .= '<label for="' . $id . '" class="selectit"><input name="' . $name . '[' . $sid . ']" value="' . attribute_escape($value) . '" ' . $checked . ' type="checkbox" /> ';
|
558 |
+
if ( $valueLabel )
|
559 |
+
$out .= stripcslashes($valueLabel);
|
560 |
+
else
|
561 |
+
$out .= stripcslashes($value);
|
562 |
+
$out .= '</label><br />';
|
563 |
|
564 |
$out .= '</dd></dl>';
|
565 |
|
566 |
return $out;
|
567 |
}
|
568 |
|
569 |
+
function make_radio( $name, $sid, $values, $valueLabel, $clearButton, $default, $hideKey, $label, $code ) {
|
570 |
$options = $this->get_custom_field_template_data();
|
571 |
|
572 |
$title = $name;
|
579 |
if( isset( $_REQUEST[ 'post' ] ) && $_REQUEST[ 'post' ] > 0 ) {
|
580 |
$selected = get_post_meta( $_REQUEST[ 'post' ], $title );
|
581 |
$selected = $selected[ $sid ];
|
582 |
+
} else {
|
|
|
583 |
$selected = $default;
|
584 |
}
|
585 |
|
604 |
|
605 |
if ( !empty($label) && !$options['custom_field_template_replace_keys_by_labels'] )
|
606 |
$out .= '<p class="label">' . stripcslashes($label) . '</p>';
|
607 |
+
$i = 0;
|
608 |
foreach( $values as $val ) {
|
609 |
$id = $name . '_' . $this->sanitize_name( $val );
|
610 |
|
611 |
$checked = ( trim( $val ) == trim( $selected ) ) ? 'checked="checked"' : '';
|
612 |
|
613 |
$out .=
|
614 |
+
'<label for="' . $id . '" class="selectit"><input id="' . $id . '" name="' . $name . '[' . $sid . ']" value="' . attribute_escape($val) . '" ' . $checked . ' type="radio" /> ';
|
615 |
+
if ( $valueLabel[$i] )
|
616 |
+
$out .= stripcslashes($valueLabel[$i]);
|
617 |
+
else
|
618 |
+
$out .= stripcslashes($val);
|
619 |
+
$out .= '</label><br />';
|
620 |
+
$i++;
|
621 |
}
|
622 |
$out .= '</dd></dl>';
|
623 |
|
624 |
return $out;
|
625 |
}
|
626 |
|
627 |
+
function make_select( $name, $sid, $values, $valueLabel, $default, $hideKey, $label, $code ) {
|
628 |
$options = $this->get_custom_field_template_data();
|
629 |
|
630 |
$title = $name;
|
639 |
if ( $selected ) {
|
640 |
$selected = $selected[ $sid ];
|
641 |
}
|
642 |
+
} else {
|
|
|
643 |
$selected = $default;
|
644 |
}
|
645 |
|
657 |
$out .= '<p class="label">' . stripcslashes($label) . '</p>';
|
658 |
$out .= '<select name="' . $name . '[]">' .
|
659 |
'<option value="" >Select</option>';
|
660 |
+
|
661 |
+
$i = 0;
|
662 |
foreach( $values as $val ) {
|
663 |
$checked = ( trim( $val ) == trim( $selected ) ) ? 'selected="selected"' : '';
|
664 |
|
665 |
+
$out .= '<option value="' . attribute_escape($val) . '" ' . $checked . ' > ';
|
666 |
+
if ( $valueLabel[$i] )
|
667 |
+
$out .= $valueLabel[$i];
|
668 |
+
else
|
669 |
+
$out .= $val;
|
670 |
+
$out .= '</option>';
|
671 |
+
$i++;
|
672 |
}
|
673 |
$out .= '</select></dd></dl>';
|
674 |
|
675 |
return $out;
|
676 |
}
|
677 |
|
678 |
+
function make_textarea( $name, $sid, $rows, $cols, $tinyMCE, $mediaButton, $default, $hideKey, $label ) {
|
679 |
$options = $this->get_custom_field_template_data();
|
680 |
|
681 |
global $wp_version;
|
686 |
if( isset( $_REQUEST[ 'post' ] ) ) {
|
687 |
$value = get_post_meta( $_REQUEST[ 'post' ], $title );
|
688 |
$value = $value[ $sid ];
|
689 |
+
} else {
|
690 |
+
$value = $default;
|
691 |
}
|
692 |
|
693 |
$rand = rand();
|
764 |
if ( $options['custom_fields'][$id]['instruction'] )
|
765 |
$out .= '<div id="cft_instruction">' . stripcslashes($options['custom_fields'][$id]['instruction']) . '</div>';
|
766 |
|
767 |
+
$out .= '<div>';
|
768 |
$out .= '<input type="hidden" name="custom-field-template-id" id="custom-field-template-id" value="' . $id . '" />';
|
769 |
foreach( $fields as $title => $data ) {
|
770 |
for($i = 0; $i<count($data); $i++) {
|
771 |
if ( is_numeric($data[$i]['level']) ) :
|
772 |
if ( $data[$i]['level'] > $level ) continue;
|
773 |
+
endif;
|
774 |
+
if( $data[$i]['type'] == 'break' ) {
|
775 |
+
$out .= '</div><div>';
|
776 |
+
}
|
777 |
+
else if( $data[$i]['type'] == 'textfield' || $data[$i]['type'] == 'text' ) {
|
778 |
+
$out .= $this->make_textfield( $title, $i, $data[$i]['size'], $data[$i]['default'], $data[$i]['hideKey'], $data[$i]['label'] );
|
779 |
}
|
780 |
else if( $data[$i]['type'] == 'checkbox' ) {
|
781 |
$out .=
|
782 |
+
$this->make_checkbox( $title, $i, $data[$i]['value'], $data[$i]['valueLabel'], $data[$i]['checked'], $data[$i]['hideKey'], $data[$i]['label'], $data[$i]['code'] );
|
783 |
}
|
784 |
else if( $data[$i]['type'] == 'radio' ) {
|
785 |
$out .=
|
786 |
$this->make_radio(
|
787 |
+
$title, $i, explode( '#', $data[$i]['value'] ), explode( '#', $data[$i]['valueLabel'] ), $data[$i]['clearButton'], $data[$i]['default'], $data[$i]['hideKey'], $data[$i]['label'], $data[$i]['code'] );
|
788 |
}
|
789 |
else if( $data[$i]['type'] == 'select' ) {
|
790 |
$out .=
|
791 |
$this->make_select(
|
792 |
+
$title, $i, explode( '#', $data[$i]['value'] ), explode( '#', $data[$i]['valueLabel'] ), $data[$i]['default'], $data[$i]['hideKey'], $data[$i]['label'], $data[$i]['code'] );
|
793 |
}
|
794 |
else if( $data[$i]['type'] == 'textarea' ) {
|
795 |
if ( $options['tinyMCE'][$_REQUEST['post']][$this->sanitize_name($title)][$i] ) $data[$i]['rows'] = $options['tinyMCE'][$_REQUEST['post']][$this->sanitize_name($title)][$i];
|
796 |
$out .=
|
797 |
+
$this->make_textarea( $title, $i, $data[$i]['rows'], $data[$i]['cols'], $data[$i]['tinyMCE'], $data[$i]['mediaButton'], $data[$i]['default'], $data[$i]['hideKey'], $data[$i]['label'] );
|
798 |
}
|
799 |
}
|
800 |
}
|
801 |
+
$out .= '</div>';
|
802 |
+
$out .= '<br style="clear:both; font-size:1px;" />';
|
803 |
|
804 |
return $out;
|
805 |
}
|
994 |
preg_match('/cw=[0-9]+&ch=([0-9]+)/', $_REQUEST['TinyMCE_' . $name . trim($_REQUEST[ $name."_rand" ][$i]) . '_size'], $matched);
|
995 |
$options['tinyMCE'][$id][$name][$i] = (int)($matched[1]/20);
|
996 |
}
|
997 |
+
} else
|
998 |
+
if ( $data[$i]['blank'] == true ) add_post_meta( $id, $title, "" );
|
999 |
}
|
1000 |
}
|
1001 |
|
1068 |
eval(stripcslashes($options['php'][$val["code"]]));
|
1069 |
else :
|
1070 |
$values = explode( '#', $val["value"] );
|
1071 |
+
$valueLabel = explode( '#', $val["valueLabel"] );
|
1072 |
$defaults = explode( '#', $val["default"] );
|
1073 |
endif;
|
1074 |
|
1078 |
|
1079 |
$tmp = $key;
|
1080 |
if ( is_array($values) ) :
|
1081 |
+
$i = 0;
|
1082 |
foreach($values as $value) {
|
1083 |
$Data[$title][$key]["type"] = "checkbox";
|
1084 |
$Data[$title][$key]["value"] = trim($value);
|
1085 |
+
if ( $valueLabel[$i] )
|
1086 |
+
$Data[$title][$key]["valueLabel"] = trim($valueLabel[$i]);
|
1087 |
if ( $tmp!=$key )
|
1088 |
$Data[$title][$key]["hideKey"] = true;
|
1089 |
if ( is_array($defaults) )
|
1096 |
if ( $val["output"] == true )
|
1097 |
$Data[$title][$key]["output"] = true;
|
1098 |
$key++;
|
1099 |
+
$i++;
|
1100 |
}
|
1101 |
endif;
|
1102 |
}
|
1112 |
|
1113 |
extract(shortcode_atts(array(
|
1114 |
'post_id' => $post->ID,
|
1115 |
+
'template' => 0,
|
1116 |
+
'format' => ''
|
1117 |
), $attr));
|
1118 |
|
1119 |
+
if ( is_numeric($format) && $output = $options['shortcode_format'][$format] ) :
|
1120 |
+
$fields = get_post_custom($post_id);
|
1121 |
+
|
1122 |
+
if( $fields == null)
|
1123 |
+
return;
|
1124 |
+
|
1125 |
+
foreach ( $fields as $key => $val ) :
|
1126 |
+
if ( count($val) > 1 ) :
|
1127 |
+
$replace_val = '<ul>';
|
1128 |
+
foreach ( $val as $val2 ) :
|
1129 |
+
$replace_val .= '<li>'.$val2.'</li>';
|
1130 |
+
endforeach;
|
1131 |
+
$replace_val .= '</ul>';
|
1132 |
+
else :
|
1133 |
+
$replace_val = $val[0];
|
1134 |
+
endif;
|
1135 |
+
|
1136 |
+
$output = preg_replace('/\['.$key.'\]/', $replace_val, $output);
|
1137 |
+
endforeach;
|
1138 |
|
1139 |
+
$fields = $this->get_custom_fields( $template );
|
1140 |
+
foreach ( $fields as $key => $val ) :
|
1141 |
+
$output = preg_replace('/\['.$key.'\]/', '', $output);
|
1142 |
+
endforeach;
|
1143 |
+
else :
|
1144 |
+
$fields = $this->get_custom_fields( $template );
|
1145 |
+
|
1146 |
+
if( $fields == null)
|
1147 |
+
return;
|
1148 |
+
|
1149 |
+
$output = '<dl class="cft">' . "\n";
|
1150 |
+
foreach ( $fields as $key => $val ) :
|
1151 |
+
$value = get_post_meta( $post_id, $key );
|
1152 |
+
if ($value):
|
1153 |
+
foreach ( $val as $key2 => $val2 ) :
|
1154 |
+
$hide = '';
|
1155 |
+
if ( $val2['output'] == true ) :
|
1156 |
+
if ( $val2['hideKey'] == true ) $hide = ' class="hideKey"';
|
1157 |
+
if ( !empty($val2['label']) && $options['custom_field_template_replace_keys_by_labels'] )
|
1158 |
+
$key = stripcslashes($val2['label']);
|
1159 |
+
if ( $val2['type'] == 'checkbox' ) :
|
1160 |
+
if( in_array($val2['value'], $value) ) :
|
1161 |
+
$output .= '<dt><span' . $hide . '>' . $key . '</span></dt>' . "\n";
|
1162 |
+
$output .= '<dd>' . $val2['value'] . '</dd>' . "\n";
|
1163 |
+
endif;
|
1164 |
+
else :
|
1165 |
+
$output .= '<dt><span' . $hide . '>' . $key . '</span></dt>' . "\n";
|
1166 |
+
$output .= '<dd>' . $value[$key2] . '</dd>' . "\n";
|
1167 |
+
endif;
|
1168 |
endif;
|
1169 |
+
endforeach;
|
|
|
|
|
|
|
1170 |
endif;
|
1171 |
endforeach;
|
1172 |
+
$output .= '</dl>' . "\n";
|
1173 |
+
endif;
|
1174 |
|
1175 |
+
return stripcslashes($output);
|
1176 |
}
|
1177 |
}
|
1178 |
|
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
|
7 |
-
Stable tag: 0.
|
8 |
|
9 |
This plugin adds the default custom fields on the Write Post/Page.
|
10 |
|
@@ -27,10 +27,16 @@ The Custom Field Template plugin adds the default custom fields on the Write Pos
|
|
27 |
* Supprt for inserting custom field values into tags automatically. (`insertTag = true`)
|
28 |
* Adds [cft] Shortcode to display the custom field template. (only shows the attributes which have `output = true`)
|
29 |
* Adds template instruction sections.
|
|
|
|
|
|
|
|
|
30 |
|
31 |
Localization
|
32 |
|
|
|
33 |
* Spanish (es_ES) - Dario Ferrer
|
|
|
34 |
|
35 |
If you have translated into your language, please let me know.
|
36 |
|
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
|
7 |
+
Stable tag: 0.8
|
8 |
|
9 |
This plugin adds the default custom fields on the Write Post/Page.
|
10 |
|
27 |
* Supprt for inserting custom field values into tags automatically. (`insertTag = true`)
|
28 |
* Adds [cft] Shortcode to display the custom field template. (only shows the attributes which have `output = true`)
|
29 |
* Adds template instruction sections.
|
30 |
+
* Adds the value label option for the case that values are diffrent from viewed values. (`valueLabel = apples # oranges # bananas`)
|
31 |
+
* Adds the blank option. (`blank = true`)
|
32 |
+
* Adds the break type. Set CSS of '#cft div'. (`type = break`)
|
33 |
+
* Adds [cft] Shortcode Format.
|
34 |
|
35 |
Localization
|
36 |
|
37 |
+
* Japanese (ja) - [Hiroaki Miyashita](http://wordpressgogo.com/)
|
38 |
* Spanish (es_ES) - Dario Ferrer
|
39 |
+
* Russian (ru_RU) - [Sonika](http://www.sonika.ru/blog/)
|
40 |
|
41 |
If you have translated into your language, please let me know.
|
42 |
|