要設定WP-Quicktag的時候出現了這樣的錯誤
Fatal error: Cannot use string offset as an array in /***/wp-content/plugins/addquicktag/addquicktag.php on line 312
找到這一篇
到addquicktag.php中
把原本的:
311 312 313 314 315 316 | for ($i = 0; $i < count($o['buttons']); $i++) { $b = $o['buttons'][$i]; $b['text'] = htmlentities(stripslashes($b['text']), ENT_COMPAT, get_option('blog_charset')); $b['start'] = htmlentities($b['start'], ENT_COMPAT, get_option('blog_charset')); $b['end'] = htmlentities($b['end'], ENT_COMPAT, get_option('blog_charset')); $nr = $i + 1; |
改成:
311 312 313 314 315 316 317 318 | for ($i = 0; $i < count($o['buttons']); $i++) { if(is_array($o)){ $b = $o['buttons'][$i]; $b['text'] = htmlentities(stripslashes($b['text']), ENT_COMPAT, get_option('blog_charset')); $b['start'] = htmlentities($b['start'], ENT_COMPAT, get_option('blog_charset')); $b['end'] = htmlentities($b['end'], ENT_COMPAT, get_option('blog_charset')); $nr = $i + 1; } |
也就是先用if(is_array($o)){}判斷後再進入真正的迴圈
問題就解決了~