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