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