php8にしたら、Warning: Undefined array keyエラーが出る
-
php8にしたところ、こちらのエラーがサイト上部に出現する様になりました。
Warning: Undefined array key -1 in /home/サーバー名/独自ドメイン/public_html/wp-includes/post-template.php on line 330
恐らくですが「1」が不定義?なのかと思うのですが、色々調べましたがどう修正してよいのかわかりませんでした。
$content = $elements[‘pages’][ $page_no – 1 ];の箇所が丁度330の位置です。
お手数ですが、分かる方ご助力お願いします。
<エラー箇所>
$page_no = $elements['page']; $content = $elements['pages'][ $page_no - 1 ]; if ( preg_match( '/<!--more(.*?)?-->/', $content, $matches ) ) { if ( has_block( 'more', $content ) ) { // Remove the core/more block delimiters. They will be left over after $content is split up. $content = preg_replace( '/<!-- \/?wp:more(.*?) -->/', '', $content ); } $content = explode( $matches[0], $content, 2 ); if ( ! empty( $matches[1] ) && ! empty( $more_link_text ) ) { $more_link_text = strip_tags( wp_kses_no_null( trim( $matches[1] ) ) ); }
4件の返信を表示中 - 1 - 4件目 (全4件中)
4件の返信を表示中 - 1 - 4件目 (全4件中)
- トピック「php8にしたら、Warning: Undefined array keyエラーが出る」には新たに返信することはできません。