undefined constants ABSPATH and WPINC in wp-includes/blocks/index.php
-
On checking the php error log after upgrading to release 6.4.1 (and php 8.0) I see
[13-Nov-2023 07:47:05 UTC] PHP Warning: Use of undefined constant ABSPATH – assumed ‘ABSPATH’ (this will throw an Error in a future version of PHP) in /home/[redacted]/public_html/wp-includes/blocks/index.php on line 8
[13-Nov-2023 07:47:05 UTC] PHP Warning: Use of undefined constant WPINC – assumed ‘WPINC’ (this will throw an Error in a future version of PHP) in /home/[redacted]/public_html/wp-includes/blocks/index.php on line 8
[13-Nov-2023 07:47:05 UTC] PHP Warning: require(ABSPATHWPINC/blocks/legacy-widget.php): failed to open stream: No such file or directory in /home/[redacted]/public_html/wp-includes/blocks/index.php on line 11
[13-Nov-2023 07:47:05 UTC] PHP Warning: require(ABSPATHWPINC/blocks/legacy-widget.php): failed to open stream: No such file or directory in /home/[redacted]/public_html/wp-includes/blocks/index.php on line 11
[13-Nov-2023 07:47:05 UTC] PHP Fatal error: require(): Failed opening required ‘ABSPATHWPINC/blocks/legacy-widget.php’ (include_path=’.:/opt/cpanel/ea-php74/root/usr/share/pear’) in /home/[redacted]/public_html/wp-includes/blocks/index.php on line 11Looking at wp-includes/blocks/index.php I see at lines 8 – 13
define( 'BLOCKS_PATH', ABSPATH . WPINC . '/blocks/' ); // Include files required for core blocks registration. require BLOCKS_PATH . 'legacy-widget.php'; require BLOCKS_PATH . 'widget-group.php'; require BLOCKS_PATH . 'require-dynamic-blocks.php';
Presumably the define at line 8 is wrong? But how to fix it?
- The topic ‘undefined constants ABSPATH and WPINC in wp-includes/blocks/index.php’ is closed to new replies.