57 $wp_limit_int = wp_convert_hr_to_bytes( WP_MEMORY_LIMIT ); |
62 $wp_limit_int = wp_convert_hr_to_bytes( WP_MEMORY_LIMIT ); |
58 if ( -1 !== $current_limit_int && ( -1 === $wp_limit_int || $wp_limit_int > $current_limit_int ) ) { |
63 if ( -1 !== $current_limit_int && ( -1 === $wp_limit_int || $wp_limit_int > $current_limit_int ) ) { |
59 @ini_set( 'memory_limit', WP_MEMORY_LIMIT ); |
64 @ini_set( 'memory_limit', WP_MEMORY_LIMIT ); |
60 } |
65 } |
61 |
66 |
62 if ( ! isset($blog_id) ) |
67 if ( ! isset( $blog_id ) ) { |
63 $blog_id = 1; |
68 $blog_id = 1; |
64 |
69 } |
65 if ( !defined('WP_CONTENT_DIR') ) |
70 |
|
71 if ( ! defined( 'WP_CONTENT_DIR' ) ) { |
66 define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); // no trailing slash, full paths only - WP_CONTENT_URL is defined further down |
72 define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); // no trailing slash, full paths only - WP_CONTENT_URL is defined further down |
67 |
73 } |
68 // Add define('WP_DEBUG', true); to wp-config.php to enable display of notices during development. |
74 |
69 if ( !defined('WP_DEBUG') ) |
75 // Add define( 'WP_DEBUG', true ); to wp-config.php to enable display of notices during development. |
|
76 if ( ! defined( 'WP_DEBUG' ) ) { |
70 define( 'WP_DEBUG', false ); |
77 define( 'WP_DEBUG', false ); |
71 |
78 } |
72 // Add define('WP_DEBUG_DISPLAY', null); to wp-config.php use the globally configured setting for |
79 |
|
80 // Add define( 'WP_DEBUG_DISPLAY', null ); to wp-config.php use the globally configured setting for |
73 // display_errors and not force errors to be displayed. Use false to force display_errors off. |
81 // display_errors and not force errors to be displayed. Use false to force display_errors off. |
74 if ( !defined('WP_DEBUG_DISPLAY') ) |
82 if ( ! defined( 'WP_DEBUG_DISPLAY' ) ) { |
75 define( 'WP_DEBUG_DISPLAY', true ); |
83 define( 'WP_DEBUG_DISPLAY', true ); |
76 |
84 } |
77 // Add define('WP_DEBUG_LOG', true); to enable error logging to wp-content/debug.log. |
85 |
78 if ( !defined('WP_DEBUG_LOG') ) |
86 // Add define( 'WP_DEBUG_LOG', true ); to enable error logging to wp-content/debug.log. |
79 define('WP_DEBUG_LOG', false); |
87 if ( ! defined( 'WP_DEBUG_LOG' ) ) { |
80 |
88 define( 'WP_DEBUG_LOG', false ); |
81 if ( !defined('WP_CACHE') ) |
89 } |
82 define('WP_CACHE', false); |
90 |
83 |
91 if ( ! defined( 'WP_CACHE' ) ) { |
84 // Add define('SCRIPT_DEBUG', true); to wp-config.php to enable loading of non-minified, |
92 define( 'WP_CACHE', false ); |
|
93 } |
|
94 |
|
95 // Add define( 'SCRIPT_DEBUG', true ); to wp-config.php to enable loading of non-minified, |
85 // non-concatenated scripts and stylesheets. |
96 // non-concatenated scripts and stylesheets. |
86 if ( ! defined( 'SCRIPT_DEBUG' ) ) { |
97 if ( ! defined( 'SCRIPT_DEBUG' ) ) { |
87 if ( ! empty( $GLOBALS['wp_version'] ) ) { |
98 if ( ! empty( $GLOBALS['wp_version'] ) ) { |
88 $develop_src = false !== strpos( $GLOBALS['wp_version'], '-src' ); |
99 $develop_src = false !== strpos( $GLOBALS['wp_version'], '-src' ); |
89 } else { |
100 } else { |
133 * Defines must-use plugin directory constants, which may be overridden in the sunrise.php drop-in |
146 * Defines must-use plugin directory constants, which may be overridden in the sunrise.php drop-in |
134 * |
147 * |
135 * @since 3.0.0 |
148 * @since 3.0.0 |
136 */ |
149 */ |
137 function wp_plugin_directory_constants() { |
150 function wp_plugin_directory_constants() { |
138 if ( !defined('WP_CONTENT_URL') ) |
151 if ( ! defined( 'WP_CONTENT_URL' ) ) { |
139 define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content'); // full url - WP_CONTENT_DIR is defined further up |
152 define( 'WP_CONTENT_URL', get_option( 'siteurl' ) . '/wp-content' ); // full url - WP_CONTENT_DIR is defined further up |
|
153 } |
140 |
154 |
141 /** |
155 /** |
142 * Allows for the plugins directory to be moved from the default location. |
156 * Allows for the plugins directory to be moved from the default location. |
143 * |
157 * |
144 * @since 2.6.0 |
158 * @since 2.6.0 |
145 */ |
159 */ |
146 if ( !defined('WP_PLUGIN_DIR') ) |
160 if ( ! defined( 'WP_PLUGIN_DIR' ) ) { |
147 define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' ); // full path, no trailing slash |
161 define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' ); // full path, no trailing slash |
|
162 } |
148 |
163 |
149 /** |
164 /** |
150 * Allows for the plugins directory to be moved from the default location. |
165 * Allows for the plugins directory to be moved from the default location. |
151 * |
166 * |
152 * @since 2.6.0 |
167 * @since 2.6.0 |
153 */ |
168 */ |
154 if ( !defined('WP_PLUGIN_URL') ) |
169 if ( ! defined( 'WP_PLUGIN_URL' ) ) { |
155 define( 'WP_PLUGIN_URL', WP_CONTENT_URL . '/plugins' ); // full url, no trailing slash |
170 define( 'WP_PLUGIN_URL', WP_CONTENT_URL . '/plugins' ); // full url, no trailing slash |
|
171 } |
156 |
172 |
157 /** |
173 /** |
158 * Allows for the plugins directory to be moved from the default location. |
174 * Allows for the plugins directory to be moved from the default location. |
159 * |
175 * |
160 * @since 2.1.0 |
176 * @since 2.1.0 |
161 * @deprecated |
177 * @deprecated |
162 */ |
178 */ |
163 if ( !defined('PLUGINDIR') ) |
179 if ( ! defined( 'PLUGINDIR' ) ) { |
164 define( 'PLUGINDIR', 'wp-content/plugins' ); // Relative to ABSPATH. For back compat. |
180 define( 'PLUGINDIR', 'wp-content/plugins' ); // Relative to ABSPATH. For back compat. |
|
181 } |
165 |
182 |
166 /** |
183 /** |
167 * Allows for the mu-plugins directory to be moved from the default location. |
184 * Allows for the mu-plugins directory to be moved from the default location. |
168 * |
185 * |
169 * @since 2.8.0 |
186 * @since 2.8.0 |
170 */ |
187 */ |
171 if ( !defined('WPMU_PLUGIN_DIR') ) |
188 if ( ! defined( 'WPMU_PLUGIN_DIR' ) ) { |
172 define( 'WPMU_PLUGIN_DIR', WP_CONTENT_DIR . '/mu-plugins' ); // full path, no trailing slash |
189 define( 'WPMU_PLUGIN_DIR', WP_CONTENT_DIR . '/mu-plugins' ); // full path, no trailing slash |
|
190 } |
173 |
191 |
174 /** |
192 /** |
175 * Allows for the mu-plugins directory to be moved from the default location. |
193 * Allows for the mu-plugins directory to be moved from the default location. |
176 * |
194 * |
177 * @since 2.8.0 |
195 * @since 2.8.0 |
178 */ |
196 */ |
179 if ( !defined('WPMU_PLUGIN_URL') ) |
197 if ( ! defined( 'WPMU_PLUGIN_URL' ) ) { |
180 define( 'WPMU_PLUGIN_URL', WP_CONTENT_URL . '/mu-plugins' ); // full url, no trailing slash |
198 define( 'WPMU_PLUGIN_URL', WP_CONTENT_URL . '/mu-plugins' ); // full url, no trailing slash |
|
199 } |
181 |
200 |
182 /** |
201 /** |
183 * Allows for the mu-plugins directory to be moved from the default location. |
202 * Allows for the mu-plugins directory to be moved from the default location. |
184 * |
203 * |
185 * @since 2.8.0 |
204 * @since 2.8.0 |
186 * @deprecated |
205 * @deprecated |
187 */ |
206 */ |
188 if ( !defined( 'MUPLUGINDIR' ) ) |
207 if ( ! defined( 'MUPLUGINDIR' ) ) { |
189 define( 'MUPLUGINDIR', 'wp-content/mu-plugins' ); // Relative to ABSPATH. For back compat. |
208 define( 'MUPLUGINDIR', 'wp-content/mu-plugins' ); // Relative to ABSPATH. For back compat. |
|
209 } |
190 } |
210 } |
191 |
211 |
192 /** |
212 /** |
193 * Defines cookie related WordPress constants |
213 * Defines cookie related WordPress constants |
194 * |
214 * |
195 * Defines constants after multisite is loaded. |
215 * Defines constants after multisite is loaded. |
|
216 * |
196 * @since 3.0.0 |
217 * @since 3.0.0 |
197 */ |
218 */ |
198 function wp_cookie_constants() { |
219 function wp_cookie_constants() { |
199 /** |
220 /** |
200 * Used to guarantee unique hash cookies |
221 * Used to guarantee unique hash cookies |
201 * |
222 * |
202 * @since 1.5.0 |
223 * @since 1.5.0 |
203 */ |
224 */ |
204 if ( !defined( 'COOKIEHASH' ) ) { |
225 if ( ! defined( 'COOKIEHASH' ) ) { |
205 $siteurl = get_site_option( 'siteurl' ); |
226 $siteurl = get_site_option( 'siteurl' ); |
206 if ( $siteurl ) |
227 if ( $siteurl ) { |
207 define( 'COOKIEHASH', md5( $siteurl ) ); |
228 define( 'COOKIEHASH', md5( $siteurl ) ); |
208 else |
229 } else { |
209 define( 'COOKIEHASH', '' ); |
230 define( 'COOKIEHASH', '' ); |
|
231 } |
210 } |
232 } |
211 |
233 |
212 /** |
234 /** |
213 * @since 2.0.0 |
235 * @since 2.0.0 |
214 */ |
236 */ |
215 if ( !defined('USER_COOKIE') ) |
237 if ( ! defined( 'USER_COOKIE' ) ) { |
216 define('USER_COOKIE', 'wordpressuser_' . COOKIEHASH); |
238 define( 'USER_COOKIE', 'wordpressuser_' . COOKIEHASH ); |
|
239 } |
217 |
240 |
218 /** |
241 /** |
219 * @since 2.0.0 |
242 * @since 2.0.0 |
220 */ |
243 */ |
221 if ( !defined('PASS_COOKIE') ) |
244 if ( ! defined( 'PASS_COOKIE' ) ) { |
222 define('PASS_COOKIE', 'wordpresspass_' . COOKIEHASH); |
245 define( 'PASS_COOKIE', 'wordpresspass_' . COOKIEHASH ); |
|
246 } |
223 |
247 |
224 /** |
248 /** |
225 * @since 2.5.0 |
249 * @since 2.5.0 |
226 */ |
250 */ |
227 if ( !defined('AUTH_COOKIE') ) |
251 if ( ! defined( 'AUTH_COOKIE' ) ) { |
228 define('AUTH_COOKIE', 'wordpress_' . COOKIEHASH); |
252 define( 'AUTH_COOKIE', 'wordpress_' . COOKIEHASH ); |
229 |
253 } |
230 /** |
254 |
231 * @since 2.6.0 |
255 /** |
232 */ |
256 * @since 2.6.0 |
233 if ( !defined('SECURE_AUTH_COOKIE') ) |
257 */ |
234 define('SECURE_AUTH_COOKIE', 'wordpress_sec_' . COOKIEHASH); |
258 if ( ! defined( 'SECURE_AUTH_COOKIE' ) ) { |
235 |
259 define( 'SECURE_AUTH_COOKIE', 'wordpress_sec_' . COOKIEHASH ); |
236 /** |
260 } |
237 * @since 2.6.0 |
261 |
238 */ |
262 /** |
239 if ( !defined('LOGGED_IN_COOKIE') ) |
263 * @since 2.6.0 |
240 define('LOGGED_IN_COOKIE', 'wordpress_logged_in_' . COOKIEHASH); |
264 */ |
|
265 if ( ! defined( 'LOGGED_IN_COOKIE' ) ) { |
|
266 define( 'LOGGED_IN_COOKIE', 'wordpress_logged_in_' . COOKIEHASH ); |
|
267 } |
241 |
268 |
242 /** |
269 /** |
243 * @since 2.3.0 |
270 * @since 2.3.0 |
244 */ |
271 */ |
245 if ( !defined('TEST_COOKIE') ) |
272 if ( ! defined( 'TEST_COOKIE' ) ) { |
246 define('TEST_COOKIE', 'wordpress_test_cookie'); |
273 define( 'TEST_COOKIE', 'wordpress_test_cookie' ); |
|
274 } |
247 |
275 |
248 /** |
276 /** |
249 * @since 1.2.0 |
277 * @since 1.2.0 |
250 */ |
278 */ |
251 if ( !defined('COOKIEPATH') ) |
279 if ( ! defined( 'COOKIEPATH' ) ) { |
252 define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('home') . '/' ) ); |
280 define( 'COOKIEPATH', preg_replace( '|https?://[^/]+|i', '', get_option( 'home' ) . '/' ) ); |
|
281 } |
253 |
282 |
254 /** |
283 /** |
255 * @since 1.5.0 |
284 * @since 1.5.0 |
256 */ |
285 */ |
257 if ( !defined('SITECOOKIEPATH') ) |
286 if ( ! defined( 'SITECOOKIEPATH' ) ) { |
258 define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('siteurl') . '/' ) ); |
287 define( 'SITECOOKIEPATH', preg_replace( '|https?://[^/]+|i', '', get_option( 'siteurl' ) . '/' ) ); |
259 |
288 } |
260 /** |
289 |
261 * @since 2.6.0 |
290 /** |
262 */ |
291 * @since 2.6.0 |
263 if ( !defined('ADMIN_COOKIE_PATH') ) |
292 */ |
|
293 if ( ! defined( 'ADMIN_COOKIE_PATH' ) ) { |
264 define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . 'wp-admin' ); |
294 define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . 'wp-admin' ); |
265 |
295 } |
266 /** |
296 |
267 * @since 2.6.0 |
297 /** |
268 */ |
298 * @since 2.6.0 |
269 if ( !defined('PLUGINS_COOKIE_PATH') ) |
299 */ |
270 define( 'PLUGINS_COOKIE_PATH', preg_replace('|https?://[^/]+|i', '', WP_PLUGIN_URL) ); |
300 if ( ! defined( 'PLUGINS_COOKIE_PATH' ) ) { |
|
301 define( 'PLUGINS_COOKIE_PATH', preg_replace( '|https?://[^/]+|i', '', WP_PLUGIN_URL ) ); |
|
302 } |
271 |
303 |
272 /** |
304 /** |
273 * @since 2.0.0 |
305 * @since 2.0.0 |
274 */ |
306 */ |
275 if ( !defined('COOKIE_DOMAIN') ) |
307 if ( ! defined( 'COOKIE_DOMAIN' ) ) { |
276 define('COOKIE_DOMAIN', false); |
308 define( 'COOKIE_DOMAIN', false ); |
277 } |
309 } |
278 |
310 |
279 /** |
311 if ( ! defined( 'RECOVERY_MODE_COOKIE' ) ) { |
280 * Defines cookie related WordPress constants |
312 /** |
|
313 * @since 5.2.0 |
|
314 */ |
|
315 define( 'RECOVERY_MODE_COOKIE', 'wordpress_rec_' . COOKIEHASH ); |
|
316 } |
|
317 } |
|
318 |
|
319 /** |
|
320 * Defines SSL-related WordPress constants. |
281 * |
321 * |
282 * @since 3.0.0 |
322 * @since 3.0.0 |
283 */ |
323 */ |
284 function wp_ssl_constants() { |
324 function wp_ssl_constants() { |
285 /** |
325 /** |
286 * @since 2.6.0 |
326 * @since 2.6.0 |
287 */ |
327 */ |
288 if ( !defined( 'FORCE_SSL_ADMIN' ) ) { |
328 if ( ! defined( 'FORCE_SSL_ADMIN' ) ) { |
289 if ( 'https' === parse_url( get_option( 'siteurl' ), PHP_URL_SCHEME ) ) { |
329 if ( 'https' === parse_url( get_option( 'siteurl' ), PHP_URL_SCHEME ) ) { |
290 define( 'FORCE_SSL_ADMIN', true ); |
330 define( 'FORCE_SSL_ADMIN', true ); |
291 } else { |
331 } else { |
292 define( 'FORCE_SSL_ADMIN', false ); |
332 define( 'FORCE_SSL_ADMIN', false ); |
293 } |
333 } |
310 */ |
350 */ |
311 function wp_functionality_constants() { |
351 function wp_functionality_constants() { |
312 /** |
352 /** |
313 * @since 2.5.0 |
353 * @since 2.5.0 |
314 */ |
354 */ |
315 if ( !defined( 'AUTOSAVE_INTERVAL' ) ) |
355 if ( ! defined( 'AUTOSAVE_INTERVAL' ) ) { |
316 define( 'AUTOSAVE_INTERVAL', 60 ); |
356 define( 'AUTOSAVE_INTERVAL', 60 ); |
|
357 } |
317 |
358 |
318 /** |
359 /** |
319 * @since 2.9.0 |
360 * @since 2.9.0 |
320 */ |
361 */ |
321 if ( !defined( 'EMPTY_TRASH_DAYS' ) ) |
362 if ( ! defined( 'EMPTY_TRASH_DAYS' ) ) { |
322 define( 'EMPTY_TRASH_DAYS', 30 ); |
363 define( 'EMPTY_TRASH_DAYS', 30 ); |
323 |
364 } |
324 if ( !defined('WP_POST_REVISIONS') ) |
365 |
325 define('WP_POST_REVISIONS', true); |
366 if ( ! defined( 'WP_POST_REVISIONS' ) ) { |
|
367 define( 'WP_POST_REVISIONS', true ); |
|
368 } |
326 |
369 |
327 /** |
370 /** |
328 * @since 3.3.0 |
371 * @since 3.3.0 |
329 */ |
372 */ |
330 if ( !defined( 'WP_CRON_LOCK_TIMEOUT' ) ) |
373 if ( ! defined( 'WP_CRON_LOCK_TIMEOUT' ) ) { |
331 define('WP_CRON_LOCK_TIMEOUT', 60); // In seconds |
374 define( 'WP_CRON_LOCK_TIMEOUT', 60 ); // In seconds |
|
375 } |
332 } |
376 } |
333 |
377 |
334 /** |
378 /** |
335 * Defines templating related WordPress constants |
379 * Defines templating related WordPress constants |
336 * |
380 * |
337 * @since 3.0.0 |
381 * @since 3.0.0 |
338 */ |
382 */ |
339 function wp_templating_constants() { |
383 function wp_templating_constants() { |
340 /** |
384 /** |
341 * Filesystem path to the current active template directory |
385 * Filesystem path to the current active template directory |
|
386 * |
342 * @since 1.5.0 |
387 * @since 1.5.0 |
343 */ |
388 */ |
344 define('TEMPLATEPATH', get_template_directory()); |
389 define( 'TEMPLATEPATH', get_template_directory() ); |
345 |
390 |
346 /** |
391 /** |
347 * Filesystem path to the current active template stylesheet directory |
392 * Filesystem path to the current active template stylesheet directory |
|
393 * |
348 * @since 2.1.0 |
394 * @since 2.1.0 |
349 */ |
395 */ |
350 define('STYLESHEETPATH', get_stylesheet_directory()); |
396 define( 'STYLESHEETPATH', get_stylesheet_directory() ); |
351 |
397 |
352 /** |
398 /** |
353 * Slug of the default theme for this installation. |
399 * Slug of the default theme for this installation. |
354 * Used as the default theme when installing new sites. |
400 * Used as the default theme when installing new sites. |
355 * It will be used as the fallback if the current theme doesn't exist. |
401 * It will be used as the fallback if the current theme doesn't exist. |
356 * |
402 * |
357 * @since 3.0.0 |
403 * @since 3.0.0 |
358 * @see WP_Theme::get_core_default_theme() |
404 * @see WP_Theme::get_core_default_theme() |
359 */ |
405 */ |
360 if ( !defined('WP_DEFAULT_THEME') ) |
406 if ( ! defined( 'WP_DEFAULT_THEME' ) ) { |
361 define( 'WP_DEFAULT_THEME', 'twentyseventeen' ); |
407 define( 'WP_DEFAULT_THEME', 'twentynineteen' ); |
362 |
408 } |
363 } |
409 |
|
410 } |