author | ymh <ymh.work@gmail.com> |
Fri, 05 Sep 2025 18:40:08 +0200 | |
changeset 21 | 48c4eec2b7e6 |
parent 19 | 3d72ae0968f4 |
child 22 | 8c2e4d02f4ef |
permissions | -rw-r--r-- |
0 | 1 |
<?php |
2 |
/** |
|
3 |
* Defines constants and global variables that can be overridden, generally in wp-config.php. |
|
4 |
* |
|
5 |
* @package WordPress |
|
6 |
*/ |
|
7 |
||
8 |
/** |
|
16 | 9 |
* Defines initial WordPress constants. |
0 | 10 |
* |
11 |
* @see wp_debug_mode() |
|
12 |
* |
|
13 |
* @since 3.0.0 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
14 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
15 |
* @global int $blog_id The current site ID. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
16 |
* @global string $wp_version The WordPress version string. |
0 | 17 |
*/ |
18 |
function wp_initial_constants() { |
|
18 | 19 |
global $blog_id, $wp_version; |
0 | 20 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
21 |
/**#@+ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
22 |
* Constants for expressing human-readable data sizes in their respective number of bytes. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
23 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
24 |
* @since 4.4.0 |
19 | 25 |
* @since 6.0.0 `PB_IN_BYTES`, `EB_IN_BYTES`, `ZB_IN_BYTES`, and `YB_IN_BYTES` were added. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
26 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
27 |
define( 'KB_IN_BYTES', 1024 ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
28 |
define( 'MB_IN_BYTES', 1024 * KB_IN_BYTES ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
29 |
define( 'GB_IN_BYTES', 1024 * MB_IN_BYTES ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
30 |
define( 'TB_IN_BYTES', 1024 * GB_IN_BYTES ); |
19 | 31 |
define( 'PB_IN_BYTES', 1024 * TB_IN_BYTES ); |
32 |
define( 'EB_IN_BYTES', 1024 * PB_IN_BYTES ); |
|
33 |
define( 'ZB_IN_BYTES', 1024 * EB_IN_BYTES ); |
|
34 |
define( 'YB_IN_BYTES', 1024 * ZB_IN_BYTES ); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
35 |
/**#@-*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
36 |
|
9 | 37 |
// Start of run timestamp. |
38 |
if ( ! defined( 'WP_START_TIMESTAMP' ) ) { |
|
39 |
define( 'WP_START_TIMESTAMP', microtime( true ) ); |
|
40 |
} |
|
41 |
||
16 | 42 |
$current_limit = ini_get( 'memory_limit' ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
43 |
$current_limit_int = wp_convert_hr_to_bytes( $current_limit ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
44 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
45 |
// Define memory limits. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
46 |
if ( ! defined( 'WP_MEMORY_LIMIT' ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
47 |
if ( false === wp_is_ini_value_changeable( 'memory_limit' ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
48 |
define( 'WP_MEMORY_LIMIT', $current_limit ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
49 |
} elseif ( is_multisite() ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
50 |
define( 'WP_MEMORY_LIMIT', '64M' ); |
0 | 51 |
} else { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
52 |
define( 'WP_MEMORY_LIMIT', '40M' ); |
0 | 53 |
} |
54 |
} |
|
55 |
||
56 |
if ( ! defined( 'WP_MAX_MEMORY_LIMIT' ) ) { |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
57 |
if ( false === wp_is_ini_value_changeable( 'memory_limit' ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
58 |
define( 'WP_MAX_MEMORY_LIMIT', $current_limit ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
59 |
} elseif ( -1 === $current_limit_int || $current_limit_int > 268435456 /* = 256M */ ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
60 |
define( 'WP_MAX_MEMORY_LIMIT', $current_limit ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
61 |
} else { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
62 |
define( 'WP_MAX_MEMORY_LIMIT', '256M' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
63 |
} |
0 | 64 |
} |
65 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
66 |
// Set memory limits. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
67 |
$wp_limit_int = wp_convert_hr_to_bytes( WP_MEMORY_LIMIT ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
68 |
if ( -1 !== $current_limit_int && ( -1 === $wp_limit_int || $wp_limit_int > $current_limit_int ) ) { |
16 | 69 |
ini_set( 'memory_limit', WP_MEMORY_LIMIT ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
70 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
71 |
|
9 | 72 |
if ( ! isset( $blog_id ) ) { |
0 | 73 |
$blog_id = 1; |
9 | 74 |
} |
0 | 75 |
|
9 | 76 |
if ( ! defined( 'WP_CONTENT_DIR' ) ) { |
16 | 77 |
define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); // No trailing slash, full paths only - WP_CONTENT_URL is defined further down. |
9 | 78 |
} |
79 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
80 |
/* |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
81 |
* Add define( 'WP_DEVELOPMENT_MODE', 'core' ), or define( 'WP_DEVELOPMENT_MODE', 'plugin' ), or |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
82 |
* define( 'WP_DEVELOPMENT_MODE', 'theme' ), or define( 'WP_DEVELOPMENT_MODE', 'all' ) to wp-config.php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
83 |
* to signify development mode for WordPress core, a plugin, a theme, or all three types respectively. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
84 |
*/ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
85 |
if ( ! defined( 'WP_DEVELOPMENT_MODE' ) ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
86 |
define( 'WP_DEVELOPMENT_MODE', '' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
87 |
} |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
88 |
|
9 | 89 |
// Add define( 'WP_DEBUG', true ); to wp-config.php to enable display of notices during development. |
90 |
if ( ! defined( 'WP_DEBUG' ) ) { |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
91 |
if ( wp_get_development_mode() || 'development' === wp_get_environment_type() ) { |
16 | 92 |
define( 'WP_DEBUG', true ); |
93 |
} else { |
|
94 |
define( 'WP_DEBUG', false ); |
|
95 |
} |
|
9 | 96 |
} |
0 | 97 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
98 |
/* |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
99 |
* Add define( 'WP_DEBUG_DISPLAY', null ); to wp-config.php to use the globally configured setting |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
100 |
* for 'display_errors' and not force errors to be displayed. Use false to force 'display_errors' off. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
101 |
*/ |
9 | 102 |
if ( ! defined( 'WP_DEBUG_DISPLAY' ) ) { |
0 | 103 |
define( 'WP_DEBUG_DISPLAY', true ); |
9 | 104 |
} |
0 | 105 |
|
9 | 106 |
// Add define( 'WP_DEBUG_LOG', true ); to enable error logging to wp-content/debug.log. |
107 |
if ( ! defined( 'WP_DEBUG_LOG' ) ) { |
|
108 |
define( 'WP_DEBUG_LOG', false ); |
|
109 |
} |
|
0 | 110 |
|
9 | 111 |
if ( ! defined( 'WP_CACHE' ) ) { |
112 |
define( 'WP_CACHE', false ); |
|
113 |
} |
|
0 | 114 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
115 |
/* |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
116 |
* Add define( 'SCRIPT_DEBUG', true ); to wp-config.php to enable loading of non-minified, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
117 |
* non-concatenated scripts and stylesheets. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
118 |
*/ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
119 |
if ( ! defined( 'SCRIPT_DEBUG' ) ) { |
18 | 120 |
if ( ! empty( $wp_version ) ) { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
121 |
$develop_src = str_contains( $wp_version, '-src' ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
122 |
} else { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
123 |
$develop_src = false; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
124 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
125 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
126 |
define( 'SCRIPT_DEBUG', $develop_src ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
127 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
128 |
|
0 | 129 |
/** |
130 |
* Private |
|
131 |
*/ |
|
9 | 132 |
if ( ! defined( 'MEDIA_TRASH' ) ) { |
133 |
define( 'MEDIA_TRASH', false ); |
|
134 |
} |
|
0 | 135 |
|
9 | 136 |
if ( ! defined( 'SHORTINIT' ) ) { |
137 |
define( 'SHORTINIT', false ); |
|
138 |
} |
|
0 | 139 |
|
16 | 140 |
// Constants for features added to WP that should short-circuit their plugin implementations. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
141 |
define( 'WP_FEATURE_BETTER_PASSWORDS', true ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
142 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
143 |
/**#@+ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
144 |
* Constants for expressing human-readable intervals |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
145 |
* in their respective number of seconds. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
146 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
147 |
* Please note that these values are approximate and are provided for convenience. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
148 |
* For example, MONTH_IN_SECONDS wrongly assumes every month has 30 days and |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
149 |
* YEAR_IN_SECONDS does not take leap years into account. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
150 |
* |
16 | 151 |
* If you need more accuracy please consider using the DateTime class (https://www.php.net/manual/en/class.datetime.php). |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
152 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
153 |
* @since 3.5.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
154 |
* @since 4.4.0 Introduced `MONTH_IN_SECONDS`. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
155 |
*/ |
0 | 156 |
define( 'MINUTE_IN_SECONDS', 60 ); |
9 | 157 |
define( 'HOUR_IN_SECONDS', 60 * MINUTE_IN_SECONDS ); |
158 |
define( 'DAY_IN_SECONDS', 24 * HOUR_IN_SECONDS ); |
|
159 |
define( 'WEEK_IN_SECONDS', 7 * DAY_IN_SECONDS ); |
|
160 |
define( 'MONTH_IN_SECONDS', 30 * DAY_IN_SECONDS ); |
|
161 |
define( 'YEAR_IN_SECONDS', 365 * DAY_IN_SECONDS ); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
162 |
/**#@-*/ |
0 | 163 |
} |
164 |
||
165 |
/** |
|
16 | 166 |
* Defines plugin directory WordPress constants. |
0 | 167 |
* |
16 | 168 |
* Defines must-use plugin directory constants, which may be overridden in the sunrise.php drop-in. |
0 | 169 |
* |
170 |
* @since 3.0.0 |
|
171 |
*/ |
|
172 |
function wp_plugin_directory_constants() { |
|
9 | 173 |
if ( ! defined( 'WP_CONTENT_URL' ) ) { |
16 | 174 |
define( 'WP_CONTENT_URL', get_option( 'siteurl' ) . '/wp-content' ); // Full URL - WP_CONTENT_DIR is defined further up. |
9 | 175 |
} |
0 | 176 |
|
177 |
/** |
|
178 |
* Allows for the plugins directory to be moved from the default location. |
|
179 |
* |
|
180 |
* @since 2.6.0 |
|
181 |
*/ |
|
9 | 182 |
if ( ! defined( 'WP_PLUGIN_DIR' ) ) { |
16 | 183 |
define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' ); // Full path, no trailing slash. |
9 | 184 |
} |
0 | 185 |
|
186 |
/** |
|
187 |
* Allows for the plugins directory to be moved from the default location. |
|
188 |
* |
|
189 |
* @since 2.6.0 |
|
190 |
*/ |
|
9 | 191 |
if ( ! defined( 'WP_PLUGIN_URL' ) ) { |
16 | 192 |
define( 'WP_PLUGIN_URL', WP_CONTENT_URL . '/plugins' ); // Full URL, no trailing slash. |
9 | 193 |
} |
0 | 194 |
|
195 |
/** |
|
196 |
* Allows for the plugins directory to be moved from the default location. |
|
197 |
* |
|
198 |
* @since 2.1.0 |
|
199 |
* @deprecated |
|
200 |
*/ |
|
9 | 201 |
if ( ! defined( 'PLUGINDIR' ) ) { |
0 | 202 |
define( 'PLUGINDIR', 'wp-content/plugins' ); // Relative to ABSPATH. For back compat. |
9 | 203 |
} |
0 | 204 |
|
205 |
/** |
|
206 |
* Allows for the mu-plugins directory to be moved from the default location. |
|
207 |
* |
|
208 |
* @since 2.8.0 |
|
209 |
*/ |
|
9 | 210 |
if ( ! defined( 'WPMU_PLUGIN_DIR' ) ) { |
16 | 211 |
define( 'WPMU_PLUGIN_DIR', WP_CONTENT_DIR . '/mu-plugins' ); // Full path, no trailing slash. |
9 | 212 |
} |
0 | 213 |
|
214 |
/** |
|
215 |
* Allows for the mu-plugins directory to be moved from the default location. |
|
216 |
* |
|
217 |
* @since 2.8.0 |
|
218 |
*/ |
|
9 | 219 |
if ( ! defined( 'WPMU_PLUGIN_URL' ) ) { |
16 | 220 |
define( 'WPMU_PLUGIN_URL', WP_CONTENT_URL . '/mu-plugins' ); // Full URL, no trailing slash. |
9 | 221 |
} |
0 | 222 |
|
223 |
/** |
|
224 |
* Allows for the mu-plugins directory to be moved from the default location. |
|
225 |
* |
|
226 |
* @since 2.8.0 |
|
227 |
* @deprecated |
|
228 |
*/ |
|
9 | 229 |
if ( ! defined( 'MUPLUGINDIR' ) ) { |
0 | 230 |
define( 'MUPLUGINDIR', 'wp-content/mu-plugins' ); // Relative to ABSPATH. For back compat. |
9 | 231 |
} |
0 | 232 |
} |
233 |
||
234 |
/** |
|
16 | 235 |
* Defines cookie-related WordPress constants. |
0 | 236 |
* |
5 | 237 |
* Defines constants after multisite is loaded. |
9 | 238 |
* |
0 | 239 |
* @since 3.0.0 |
240 |
*/ |
|
241 |
function wp_cookie_constants() { |
|
242 |
/** |
|
16 | 243 |
* Used to guarantee unique hash cookies. |
5 | 244 |
* |
245 |
* @since 1.5.0 |
|
0 | 246 |
*/ |
9 | 247 |
if ( ! defined( 'COOKIEHASH' ) ) { |
0 | 248 |
$siteurl = get_site_option( 'siteurl' ); |
9 | 249 |
if ( $siteurl ) { |
0 | 250 |
define( 'COOKIEHASH', md5( $siteurl ) ); |
9 | 251 |
} else { |
0 | 252 |
define( 'COOKIEHASH', '' ); |
9 | 253 |
} |
254 |
} |
|
255 |
||
256 |
/** |
|
257 |
* @since 2.0.0 |
|
258 |
*/ |
|
259 |
if ( ! defined( 'USER_COOKIE' ) ) { |
|
260 |
define( 'USER_COOKIE', 'wordpressuser_' . COOKIEHASH ); |
|
0 | 261 |
} |
262 |
||
263 |
/** |
|
264 |
* @since 2.0.0 |
|
265 |
*/ |
|
9 | 266 |
if ( ! defined( 'PASS_COOKIE' ) ) { |
267 |
define( 'PASS_COOKIE', 'wordpresspass_' . COOKIEHASH ); |
|
268 |
} |
|
0 | 269 |
|
270 |
/** |
|
271 |
* @since 2.5.0 |
|
272 |
*/ |
|
9 | 273 |
if ( ! defined( 'AUTH_COOKIE' ) ) { |
274 |
define( 'AUTH_COOKIE', 'wordpress_' . COOKIEHASH ); |
|
275 |
} |
|
0 | 276 |
|
277 |
/** |
|
278 |
* @since 2.6.0 |
|
279 |
*/ |
|
9 | 280 |
if ( ! defined( 'SECURE_AUTH_COOKIE' ) ) { |
281 |
define( 'SECURE_AUTH_COOKIE', 'wordpress_sec_' . COOKIEHASH ); |
|
282 |
} |
|
0 | 283 |
|
284 |
/** |
|
285 |
* @since 2.6.0 |
|
286 |
*/ |
|
9 | 287 |
if ( ! defined( 'LOGGED_IN_COOKIE' ) ) { |
288 |
define( 'LOGGED_IN_COOKIE', 'wordpress_logged_in_' . COOKIEHASH ); |
|
289 |
} |
|
0 | 290 |
|
291 |
/** |
|
292 |
* @since 2.3.0 |
|
293 |
*/ |
|
9 | 294 |
if ( ! defined( 'TEST_COOKIE' ) ) { |
295 |
define( 'TEST_COOKIE', 'wordpress_test_cookie' ); |
|
296 |
} |
|
0 | 297 |
|
298 |
/** |
|
299 |
* @since 1.2.0 |
|
300 |
*/ |
|
9 | 301 |
if ( ! defined( 'COOKIEPATH' ) ) { |
302 |
define( 'COOKIEPATH', preg_replace( '|https?://[^/]+|i', '', get_option( 'home' ) . '/' ) ); |
|
303 |
} |
|
0 | 304 |
|
305 |
/** |
|
306 |
* @since 1.5.0 |
|
307 |
*/ |
|
9 | 308 |
if ( ! defined( 'SITECOOKIEPATH' ) ) { |
309 |
define( 'SITECOOKIEPATH', preg_replace( '|https?://[^/]+|i', '', get_option( 'siteurl' ) . '/' ) ); |
|
310 |
} |
|
0 | 311 |
|
312 |
/** |
|
313 |
* @since 2.6.0 |
|
314 |
*/ |
|
9 | 315 |
if ( ! defined( 'ADMIN_COOKIE_PATH' ) ) { |
0 | 316 |
define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . 'wp-admin' ); |
9 | 317 |
} |
0 | 318 |
|
319 |
/** |
|
320 |
* @since 2.6.0 |
|
321 |
*/ |
|
9 | 322 |
if ( ! defined( 'PLUGINS_COOKIE_PATH' ) ) { |
323 |
define( 'PLUGINS_COOKIE_PATH', preg_replace( '|https?://[^/]+|i', '', WP_PLUGIN_URL ) ); |
|
324 |
} |
|
0 | 325 |
|
326 |
/** |
|
327 |
* @since 2.0.0 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
328 |
* @since 6.6.0 The value has changed from false to an empty string. |
0 | 329 |
*/ |
9 | 330 |
if ( ! defined( 'COOKIE_DOMAIN' ) ) { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
331 |
define( 'COOKIE_DOMAIN', '' ); |
9 | 332 |
} |
333 |
||
334 |
if ( ! defined( 'RECOVERY_MODE_COOKIE' ) ) { |
|
335 |
/** |
|
336 |
* @since 5.2.0 |
|
337 |
*/ |
|
338 |
define( 'RECOVERY_MODE_COOKIE', 'wordpress_rec_' . COOKIEHASH ); |
|
339 |
} |
|
0 | 340 |
} |
341 |
||
342 |
/** |
|
9 | 343 |
* Defines SSL-related WordPress constants. |
0 | 344 |
* |
345 |
* @since 3.0.0 |
|
346 |
*/ |
|
347 |
function wp_ssl_constants() { |
|
348 |
/** |
|
349 |
* @since 2.6.0 |
|
350 |
*/ |
|
9 | 351 |
if ( ! defined( 'FORCE_SSL_ADMIN' ) ) { |
5 | 352 |
if ( 'https' === parse_url( get_option( 'siteurl' ), PHP_URL_SCHEME ) ) { |
353 |
define( 'FORCE_SSL_ADMIN', true ); |
|
354 |
} else { |
|
355 |
define( 'FORCE_SSL_ADMIN', false ); |
|
356 |
} |
|
357 |
} |
|
358 |
force_ssl_admin( FORCE_SSL_ADMIN ); |
|
0 | 359 |
|
360 |
/** |
|
361 |
* @since 2.6.0 |
|
5 | 362 |
* @deprecated 4.0.0 |
0 | 363 |
*/ |
5 | 364 |
if ( defined( 'FORCE_SSL_LOGIN' ) && FORCE_SSL_LOGIN ) { |
365 |
force_ssl_admin( true ); |
|
366 |
} |
|
0 | 367 |
} |
368 |
||
369 |
/** |
|
16 | 370 |
* Defines functionality-related WordPress constants. |
0 | 371 |
* |
372 |
* @since 3.0.0 |
|
373 |
*/ |
|
374 |
function wp_functionality_constants() { |
|
375 |
/** |
|
376 |
* @since 2.5.0 |
|
377 |
*/ |
|
9 | 378 |
if ( ! defined( 'AUTOSAVE_INTERVAL' ) ) { |
16 | 379 |
define( 'AUTOSAVE_INTERVAL', MINUTE_IN_SECONDS ); |
9 | 380 |
} |
0 | 381 |
|
382 |
/** |
|
383 |
* @since 2.9.0 |
|
384 |
*/ |
|
9 | 385 |
if ( ! defined( 'EMPTY_TRASH_DAYS' ) ) { |
0 | 386 |
define( 'EMPTY_TRASH_DAYS', 30 ); |
9 | 387 |
} |
0 | 388 |
|
9 | 389 |
if ( ! defined( 'WP_POST_REVISIONS' ) ) { |
390 |
define( 'WP_POST_REVISIONS', true ); |
|
391 |
} |
|
0 | 392 |
|
393 |
/** |
|
394 |
* @since 3.3.0 |
|
395 |
*/ |
|
9 | 396 |
if ( ! defined( 'WP_CRON_LOCK_TIMEOUT' ) ) { |
16 | 397 |
define( 'WP_CRON_LOCK_TIMEOUT', MINUTE_IN_SECONDS ); |
9 | 398 |
} |
0 | 399 |
} |
400 |
||
401 |
/** |
|
16 | 402 |
* Defines templating-related WordPress constants. |
0 | 403 |
* |
404 |
* @since 3.0.0 |
|
405 |
*/ |
|
406 |
function wp_templating_constants() { |
|
407 |
/** |
|
16 | 408 |
* Filesystem path to the current active template directory. |
9 | 409 |
* |
0 | 410 |
* @since 1.5.0 |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
411 |
* @deprecated 6.4.0 Use get_template_directory() instead. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
412 |
* @see get_template_directory() |
0 | 413 |
*/ |
9 | 414 |
define( 'TEMPLATEPATH', get_template_directory() ); |
0 | 415 |
|
416 |
/** |
|
16 | 417 |
* Filesystem path to the current active template stylesheet directory. |
9 | 418 |
* |
0 | 419 |
* @since 2.1.0 |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
420 |
* @deprecated 6.4.0 Use get_stylesheet_directory() instead. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
421 |
* @see get_stylesheet_directory() |
0 | 422 |
*/ |
9 | 423 |
define( 'STYLESHEETPATH', get_stylesheet_directory() ); |
0 | 424 |
|
425 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
426 |
* Slug of the default theme for this installation. |
0 | 427 |
* Used as the default theme when installing new sites. |
19 | 428 |
* It will be used as the fallback if the active theme doesn't exist. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
429 |
* |
0 | 430 |
* @since 3.0.0 |
16 | 431 |
* |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
432 |
* @see WP_Theme::get_core_default_theme() |
0 | 433 |
*/ |
9 | 434 |
if ( ! defined( 'WP_DEFAULT_THEME' ) ) { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
435 |
define( 'WP_DEFAULT_THEME', 'twentytwentyfour' ); |
9 | 436 |
} |
0 | 437 |
} |