前提・実現したいこと
WordPress5.0の更新でアップデートしたところ、
使用していたプラグイン【List category posts】がエラーを起こしています。
サイト全体が表示されなくなりました。
(プラグインを停止させると、表示はされます)
【List category posts】というプラグインを使って、
投稿の一部のカテゴリのみを、新着で表示されるようにしていました。
今後も、同様に使用したいのですが、
PHPファイルのエラーをどのように修正すればよいか分かりません。
ご教授いただければありがたいですm(_ _)m
よろしくお願いいたします。
発生している問題・エラーメッセージ
Parse error: syntax error, unexpected '[' 〇〇〇〇/wp-content/plugins/list-category-posts/include/lcp-widget.php on line 87
該当のソースコード
// Fetch the category id from the Catlist instance. $category_id = $catlist_displayer->catlist->get_category_id(); if ((is_null($category_id) || [0] === $category_id ) && ($title == 'catlink' || $title == 'catname')) { $title = ''; } elseif ($title == 'catlink') { // If the user has setup 'catlink' as the title, replace it with // the category link: $lcp_category = get_category($category_id); $title = '<a href="' . get_category_link($lcp_category->cat_ID) . '">' . $lcp_category->name . '</a>'; } elseif ($title == 'catname') { // If the user has setup 'catname' as the title, replace it with // the category link: $lcp_category = get_category($category_id); $title = $lcp_category->name; }
上から3行目あたりが87行目
試したこと
プラグイン削除
補足情報(FW/ツールのバージョンなど)
MySQL 5.6
PHP 7.1
回答1件
あなたの回答
tips
プレビュー