質問編集履歴
2
誤字修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -188,7 +188,7 @@
|
|
188
188
|
|
189
189
|
###追記
|
190
190
|
|
191
|
-
上
|
191
|
+
上のは解決したのですが今度は
|
192
192
|
|
193
193
|
|
194
194
|
|
1
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -183,3 +183,187 @@
|
|
183
183
|
###補足情報(言語/FW/ツール等のバージョンなど)
|
184
184
|
|
185
185
|
PHP 7 wordpress最新
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
###追記
|
190
|
+
|
191
|
+
上野は解決したのですが今度は
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
コード
|
196
|
+
|
197
|
+
```php
|
198
|
+
|
199
|
+
<?php
|
200
|
+
|
201
|
+
/*
|
202
|
+
|
203
|
+
Plugin Name: KeywordsChenge
|
204
|
+
|
205
|
+
Plugin URI:
|
206
|
+
|
207
|
+
Description: Change the search keyword in the web page.
|
208
|
+
|
209
|
+
Version: 1.0
|
210
|
+
|
211
|
+
Author: mk
|
212
|
+
|
213
|
+
Author URI:
|
214
|
+
|
215
|
+
License: GPL2
|
216
|
+
|
217
|
+
*/
|
218
|
+
|
219
|
+
/* Copyright 2016 mk (email : yamk4054@gmail.com)
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
This program is free software; you can redistribute it and/or modify
|
224
|
+
|
225
|
+
it under the terms of the GNU General Public License, version 2, as
|
226
|
+
|
227
|
+
published by the Free Software Foundation.
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
This program is distributed in the hope that it will be useful,
|
232
|
+
|
233
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
234
|
+
|
235
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
236
|
+
|
237
|
+
GNU General Public License for more details.
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
You should have received a copy of the GNU General Public License
|
242
|
+
|
243
|
+
along with this program; if not, write to the Free Software
|
244
|
+
|
245
|
+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
246
|
+
|
247
|
+
*/
|
248
|
+
|
249
|
+
//lang
|
250
|
+
|
251
|
+
$mk_kc_lang_title = "キーワード管理";
|
252
|
+
|
253
|
+
$mk_kc_lang_screen_title = "キーワード管理画面";
|
254
|
+
|
255
|
+
$mk_kc_lang_keyword = "キーワード";
|
256
|
+
|
257
|
+
$mk_kc_lang_save_messege = "変更を保存しました";
|
258
|
+
|
259
|
+
$mk_kc_lang_save_button = "変更を保存";
|
260
|
+
|
261
|
+
//settings
|
262
|
+
|
263
|
+
$mk_kc_settings_maxkyes = 5; //Google of the recommended number of keywords,5 keywords.
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
add_action( 'admin_menu', 'mk_kc_add_plugin_admin_menu' );
|
268
|
+
|
269
|
+
function mk_kc_add_plugin_admin_menu() {add_options_page($mk_kc_lang_title,$mk_kc_lang_screen_title,'administrator', 'keywords','mk_kc_display_plugin_admin_page');}
|
270
|
+
|
271
|
+
function mk_kc_display_plugin_admin_page() {
|
272
|
+
|
273
|
+
if ( isset($_POST['mk_kc_options'])) {check_admin_referer('kcoptions');$opt = $_POST['mk_kc_options'];update_option('mk_kc_options', $opt);
|
274
|
+
|
275
|
+
?>
|
276
|
+
|
277
|
+
<div class="updated fade"><p><strong><?php _e($mk_kc_lang_save_messege); ?></strong></p></div>
|
278
|
+
|
279
|
+
<?php
|
280
|
+
|
281
|
+
}
|
282
|
+
|
283
|
+
?>
|
284
|
+
|
285
|
+
<div class="wrap">
|
286
|
+
|
287
|
+
<div id="icon-options-general" class="icon32"><br /></div><h2><?php echo $mk_kc_lang_screen_title ?></h2>
|
288
|
+
|
289
|
+
<form action="" method="post">
|
290
|
+
|
291
|
+
<?php
|
292
|
+
|
293
|
+
wp_nonce_field('kcoptions');
|
294
|
+
|
295
|
+
$opt = get_option('mk_kc_options');
|
296
|
+
|
297
|
+
for ($mk_kc_system_i = 1;$mk_kc_system_i < $mk_kc_settings_maxkyes;$mk_kc_system_i += 1){
|
298
|
+
|
299
|
+
$show_text[$mk_kc_system_i] = isset($opt['key'[$mk_kc_system_i]]) ? $opt['key'[$mk_kc_system_i]]: null;
|
300
|
+
|
301
|
+
}
|
302
|
+
|
303
|
+
?>
|
304
|
+
|
305
|
+
<table class="form-table">
|
306
|
+
|
307
|
+
<?php
|
308
|
+
|
309
|
+
for ($mk_kc_system_i = 1;$mk_kc_system_i < $mk_kc_settings_maxkyes;$mk_kc_system_i += 1){
|
310
|
+
|
311
|
+
echo "\t<tr valign=\"top\"><th scope=\"row\"><label for=\"inputtext\">" & $mk_kc_lang_keyword & "</label></th><td><input name=\"mk_kc_options[key["$mk_kc_system_i"]]\" type=\"key\" id=\"inputtext\" value=" & $show_text[$mk_kc_system_i] & " class=\"regular-text\" /></td></tr>\n\t\t\t";
|
312
|
+
|
313
|
+
}
|
314
|
+
|
315
|
+
?>
|
316
|
+
|
317
|
+
</table>
|
318
|
+
|
319
|
+
<p class="submit"><input type="submit" name="Submit" class="button-primary" value="<?php echo $mk_kc_lang_save_button ?>" /></p>
|
320
|
+
|
321
|
+
</form>
|
322
|
+
|
323
|
+
<!-- /.wrap --></div>
|
324
|
+
|
325
|
+
<?php}
|
326
|
+
|
327
|
+
//main
|
328
|
+
|
329
|
+
function mk_kc_get_key($num) {
|
330
|
+
|
331
|
+
$opt = get_option('mk_kc_options');
|
332
|
+
|
333
|
+
$array = $opt['text'];
|
334
|
+
|
335
|
+
$array[0] = "";
|
336
|
+
|
337
|
+
if ($num == "List"){
|
338
|
+
|
339
|
+
return implode(",",$array);
|
340
|
+
|
341
|
+
}elseif (is_int($num)){
|
342
|
+
|
343
|
+
if{
|
344
|
+
|
345
|
+
$array[$num]
|
346
|
+
|
347
|
+
}else{
|
348
|
+
|
349
|
+
return "";
|
350
|
+
|
351
|
+
}
|
352
|
+
|
353
|
+
}else{return "";}
|
354
|
+
|
355
|
+
|
356
|
+
|
357
|
+
}
|
358
|
+
|
359
|
+
?>
|
360
|
+
|
361
|
+
```
|
362
|
+
|
363
|
+
```
|
364
|
+
|
365
|
+
Parse error: syntax error, unexpected ';', expecting ')' in xxx/wp-content/plugins/KeywordsChenge/Plugin.php on line 56
|
366
|
+
|
367
|
+
```
|
368
|
+
|
369
|
+
上のエラーが出てしまいました
|