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