mirror of
git://develop.git.wordpress.org/
synced 2025-04-13 00:22:52 +02:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@54406 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
75a4551107
commit
f96d9ade2d
@ -49,8 +49,8 @@ ${ staticBlockFolderNames }
|
||||
.filter( isDynamic )
|
||||
.map( toDirectoryName )
|
||||
.sort()
|
||||
// To PHP require statement:
|
||||
.map( dirname => `require ABSPATH . WPINC . '/blocks/${ dirname }.php';` )
|
||||
// To PHP require_once statement:
|
||||
.map( dirname => `require_once ABSPATH . WPINC . '/blocks/${ dirname }.php';` )
|
||||
.join( "\n" );
|
||||
|
||||
fs.writeFileSync(
|
||||
|
Loading…
x
Reference in New Issue
Block a user