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