General: Revert an earlier define of the WPINC constant in src/index.php.

This avoids a `Constant WPINC already defined in src/wp-settings.php on line 16` PHP warning, which happens when running a WordPress install out of the `src` directory after `npm run build:dev`.

Add a comment to clarify the check for built assets and the direct mention of `wp-includes`.

Follow-up to [53518].

Props aristath.
See #54233.

git-svn-id: https://develop.svn.wordpress.org/trunk@53579 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2022-06-27 10:18:44 +00:00
parent b6aabe46b7
commit b03466a79d

View File

@@ -11,13 +11,16 @@ if ( ! defined( 'ABSPATH' ) ) {
define( 'ABSPATH', __DIR__ . '/' );
}
define( 'WPINC', 'wp-includes' );
if ( file_exists( ABSPATH . WPINC . '/js/dist/edit-post.js' ) ) {
/*
* Load the actual index.php file if the assets were already built.
* Note: WPINC is not defined yet, it is defined later in wp-settings.php.
*/
if ( file_exists( ABSPATH . 'wp-includes/js/dist/edit-post.js' ) ) {
require_once ABSPATH . '_index.php';
return;
}
define( 'WPINC', 'wp-includes' );
require_once ABSPATH . WPINC . '/load.php';
// Standardize $_SERVER variables across setups.