Make WordPress Core

Changeset 54406


Ignore:
Timestamp:
10/07/2022 01:56:31 AM (19 months ago)
Author:
desrosj
Message:

Build/Test Tools: Use require_once instead of require.

The sync-stable-blocks.js file is used to compile the contents of require-dynamic-blocks.php, which includes the PHP files required for dynamic Core blocks.

Since these files define PHP functions, require_once should be used instead of require to guard against fatal errors.

Follow up to [53688].

Props aristath, SergeyBiryukov, desrosj.
Fixes #56738. See #56179.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/release/sync-stable-blocks.js

    r53688 r54406  
    5050        .map( toDirectoryName )
    5151        .sort()
    52         // To PHP require statement:
    53         .map( dirname => `require ABSPATH . WPINC . '/blocks/${ dirname }.php';` )
     52        // To PHP require_once statement:
     53        .map( dirname => `require_once ABSPATH . WPINC . '/blocks/${ dirname }.php';` )
    5454        .join( "\n" );
    5555
Note: See TracChangeset for help on using the changeset viewer.