SEO用のキーワード変更WordpressPluginを作っています。
以下のエラーメッセージが発生しました。
どうすればいいですか
###発生している問題・エラーメッセージ
Parse error: syntax error, unexpected ';', expecting ')' in xxx/wp-content/plugins/KeywordsChenge/Plugin.php on line 50
###該当のソースコード
PHP
<?php /* Plugin Name: KeywordsChenge Plugin URI: Description: Change the search keyword in the web page. Version: 1.0 Author: mk Author URI: License: GPL2 */ /* Copyright 2016 mk (email : yamk4054@gmail.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ //lang $mk_kc_lang_title = "キーワード管理"; $mk_kc_lang_screen_title = "キーワード管理画面"; $mk_kc_lang_keyword = "キーワード"; $mk_kc_lang_save_messege = "変更を保存しました"; $mk_kc_lang_save_button = "変更を保存"; //settings $mk_kc_settings_maxkyes = 5; //Google of the recommended number of keywords,5 keywords. add_action( 'admin_menu', 'mk_kc_add_plugin_admin_menu' ); 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');} function mk_kc_display_plugin_admin_page() { if ( isset($_POST['mk_kc_options'])) {check_admin_referer('kcoptions');$opt = $_POST['mk_kc_options'];update_option('mk_kc_options', $opt); ?> <div class="updated fade"><p><strong><?php _e($mk_kc_lang_save_messege); ?></strong></p></div> <?php } ?> <div class="wrap"> <div id="icon-options-general" class="icon32"><br /></div><h2><?php echo $mk_kc_lang_screen_title ?></h2> <form action="" method="post"> <?php wp_nonce_field('kcoptions'); $opt = get_option('mk_kc_options'); for ($mk_kc_system_i = 1;$mk_kc_system_i < $mk_kc_settings_maxkyes;$mk_kc_system_i += 1;){ $show_text[$mk_kc_system_i] = isset($opt['key'[$mk_kc_system_i]]) ? $opt['key'[$mk_kc_system_i]]: null; } ?> <table class="form-table"> <?php for ($mk_kc_system_i = 1,$mk_kc_system_i < $mk_kc_settings_maxkyes,$mk_kc_system_i += 1;){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"} ?> </table> <p class="submit"><input type="submit" name="Submit" class="button-primary" value="<?php echo $mk_kc_lang_save_button ?>" /></p> </form> <!-- /.wrap --></div> <?php} //main function mk_kc_get_key($num) { $opt = get_option('mk_kc_options'); $array = $opt['text']; $array[0] = ""; if ($num == "List"){ return implode(",",$array); }elseif (is_int($num)){ if{ $array[$num] }else{ return ""; } }else{return "";} } ?>
###補足情報(言語/FW/ツール等のバージョンなど)
PHP 7 wordpress最新
###追記
上のは解決したのですが今度は
コード
php
<?php /* Plugin Name: KeywordsChenge Plugin URI: Description: Change the search keyword in the web page. Version: 1.0 Author: mk Author URI: License: GPL2 */ /* Copyright 2016 mk (email : yamk4054@gmail.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ //lang $mk_kc_lang_title = "キーワード管理"; $mk_kc_lang_screen_title = "キーワード管理画面"; $mk_kc_lang_keyword = "キーワード"; $mk_kc_lang_save_messege = "変更を保存しました"; $mk_kc_lang_save_button = "変更を保存"; //settings $mk_kc_settings_maxkyes = 5; //Google of the recommended number of keywords,5 keywords. add_action( 'admin_menu', 'mk_kc_add_plugin_admin_menu' ); 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');} function mk_kc_display_plugin_admin_page() { if ( isset($_POST['mk_kc_options'])) {check_admin_referer('kcoptions');$opt = $_POST['mk_kc_options'];update_option('mk_kc_options', $opt); ?> <div class="updated fade"><p><strong><?php _e($mk_kc_lang_save_messege); ?></strong></p></div> <?php } ?> <div class="wrap"> <div id="icon-options-general" class="icon32"><br /></div><h2><?php echo $mk_kc_lang_screen_title ?></h2> <form action="" method="post"> <?php wp_nonce_field('kcoptions'); $opt = get_option('mk_kc_options'); for ($mk_kc_system_i = 1;$mk_kc_system_i < $mk_kc_settings_maxkyes;$mk_kc_system_i += 1){ $show_text[$mk_kc_system_i] = isset($opt['key'[$mk_kc_system_i]]) ? $opt['key'[$mk_kc_system_i]]: null; } ?> <table class="form-table"> <?php for ($mk_kc_system_i = 1;$mk_kc_system_i < $mk_kc_settings_maxkyes;$mk_kc_system_i += 1){ 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"; } ?> </table> <p class="submit"><input type="submit" name="Submit" class="button-primary" value="<?php echo $mk_kc_lang_save_button ?>" /></p> </form> <!-- /.wrap --></div> <?php} //main function mk_kc_get_key($num) { $opt = get_option('mk_kc_options'); $array = $opt['text']; $array[0] = ""; if ($num == "List"){ return implode(",",$array); }elseif (is_int($num)){ if{ $array[$num] }else{ return ""; } }else{return "";} } ?>
Parse error: syntax error, unexpected ';', expecting ')' in xxx/wp-content/plugins/KeywordsChenge/Plugin.php on line 56
上のエラーが出てしまいました
まだ回答がついていません
会員登録して回答してみよう