Skip to content

Commit ee10b5a

Browse files
committed
Add STATIC_DEPLOY_WP_ORG_MODE constant
There are some functions that are required for wordpress.org that are simply bad choices. Create a constant to control the use of these bad choices so that we can enable them for WP.org builds but completely remove from other builds. Functions that actually have some value should be gated by other constants.
1 parent e5da180 commit ee10b5a

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

constants.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,11 @@
77
* in order to remove code entirely at build-time if
88
* a feature is disabled.
99
*/
10+
11+
// Disable the use of functions that wordpress.org requires
12+
// but we would not use when we aren't forced to.
13+
// e.g. using wp_rand instead of mt_rand in a context
14+
// where a CSPRNG adds no value.
15+
// This is just to enable useless functions, not WP
16+
// functions that do serve some purpose.
17+
define( 'STATIC_DEPLOY_WP_ORG_MODE', false );

wp-org/constants.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,11 @@
1515
// Require use of wp_* functions and WP_Filesystem
1616
// rather than direct file access.
1717
define( 'STATIC_DEPLOY_DIRECT_FILE_ACCESS', false );
18+
19+
// Force the use of functions that wordpress.org requires
20+
// but we would not use when we aren't forced to.
21+
// e.g. using wp_rand instead of mt_rand in a context
22+
// where a CSPRNG adds no value.
23+
// This is just to enable useless functions, not WP
24+
// functions that do serve some purpose.
25+
define( 'STATIC_DEPLOY_WP_ORG_MODE', true );

0 commit comments

Comments
 (0)