Make WordPress Core

Changeset 53579


Ignore:
Timestamp:
06/27/2022 10:18:44 AM (3 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/index.php

    r53519 r53579  
    1212}
    1313
    14 define( 'WPINC', 'wp-includes' );
    15 
    16 if ( file_exists( ABSPATH . WPINC . '/js/dist/edit-post.js' ) ) {
     14/*
     15 * Load the actual index.php file if the assets were already built.
     16 * Note: WPINC is not defined yet, it is defined later in wp-settings.php.
     17 */
     18if ( file_exists( ABSPATH . 'wp-includes/js/dist/edit-post.js' ) ) {
    1719    require_once ABSPATH . '_index.php';
    1820    return;
    1921}
    2022
     23define( 'WPINC', 'wp-includes' );
    2124require_once ABSPATH . WPINC . '/load.php';
    2225
Note: See TracChangeset for help on using the changeset viewer.