Changeset 42343 for trunk/src/wp-includes/default-constants.php
- Timestamp:
- 11/30/2017 11:09:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/default-constants.php
r41959 r42343 60 60 } 61 61 62 if ( ! isset( $blog_id) )62 if ( ! isset( $blog_id ) ) { 63 63 $blog_id = 1; 64 65 if ( !defined('WP_CONTENT_DIR') ) 64 } 65 66 if ( ! defined( 'WP_CONTENT_DIR' ) ) { 66 67 define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); // no trailing slash, full paths only - WP_CONTENT_URL is defined further down 68 } 67 69 68 70 // Add define('WP_DEBUG', true); to wp-config.php to enable display of notices during development. 69 if ( ! defined('WP_DEBUG') )71 if ( ! defined( 'WP_DEBUG' ) ) { 70 72 define( 'WP_DEBUG', false ); 73 } 71 74 72 75 // Add define('WP_DEBUG_DISPLAY', null); to wp-config.php use the globally configured setting for 73 76 // display_errors and not force errors to be displayed. Use false to force display_errors off. 74 if ( ! defined('WP_DEBUG_DISPLAY') )77 if ( ! defined( 'WP_DEBUG_DISPLAY' ) ) { 75 78 define( 'WP_DEBUG_DISPLAY', true ); 79 } 76 80 77 81 // Add define('WP_DEBUG_LOG', true); to enable error logging to wp-content/debug.log. 78 if ( !defined('WP_DEBUG_LOG') ) 79 define('WP_DEBUG_LOG', false); 80 81 if ( !defined('WP_CACHE') ) 82 define('WP_CACHE', false); 82 if ( ! defined( 'WP_DEBUG_LOG' ) ) { 83 define( 'WP_DEBUG_LOG', false ); 84 } 85 86 if ( ! defined( 'WP_CACHE' ) ) { 87 define( 'WP_CACHE', false ); 88 } 83 89 84 90 // Add define('SCRIPT_DEBUG', true); to wp-config.php to enable loading of non-minified, … … 97 103 * Private 98 104 */ 99 if ( !defined('MEDIA_TRASH') ) 100 define('MEDIA_TRASH', false); 101 102 if ( !defined('SHORTINIT') ) 103 define('SHORTINIT', false); 105 if ( ! defined( 'MEDIA_TRASH' ) ) { 106 define( 'MEDIA_TRASH', false ); 107 } 108 109 if ( ! defined( 'SHORTINIT' ) ) { 110 define( 'SHORTINIT', false ); 111 } 104 112 105 113 // Constants for features added to WP that should short-circuit their plugin implementations … … 120 128 */ 121 129 define( 'MINUTE_IN_SECONDS', 60 ); 122 define( 'HOUR_IN_SECONDS', 123 define( 'DAY_IN_SECONDS', 24 * HOUR_IN_SECONDS);124 define( 'WEEK_IN_SECONDS', 7 * DAY_IN_SECONDS);125 define( 'MONTH_IN_SECONDS', 30 * DAY_IN_SECONDS);126 define( 'YEAR_IN_SECONDS', 365 * DAY_IN_SECONDS);130 define( 'HOUR_IN_SECONDS', 60 * MINUTE_IN_SECONDS ); 131 define( 'DAY_IN_SECONDS', 24 * HOUR_IN_SECONDS ); 132 define( 'WEEK_IN_SECONDS', 7 * DAY_IN_SECONDS ); 133 define( 'MONTH_IN_SECONDS', 30 * DAY_IN_SECONDS ); 134 define( 'YEAR_IN_SECONDS', 365 * DAY_IN_SECONDS ); 127 135 /**#@-*/ 128 136 } … … 136 144 */ 137 145 function wp_plugin_directory_constants() { 138 if ( !defined('WP_CONTENT_URL') ) 139 define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content'); // full url - WP_CONTENT_DIR is defined further up 146 if ( ! defined( 'WP_CONTENT_URL' ) ) { 147 define( 'WP_CONTENT_URL', get_option( 'siteurl' ) . '/wp-content' ); // full url - WP_CONTENT_DIR is defined further up 148 } 140 149 141 150 /** … … 144 153 * @since 2.6.0 145 154 */ 146 if ( ! defined('WP_PLUGIN_DIR') )155 if ( ! defined( 'WP_PLUGIN_DIR' ) ) { 147 156 define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' ); // full path, no trailing slash 157 } 148 158 149 159 /** … … 152 162 * @since 2.6.0 153 163 */ 154 if ( ! defined('WP_PLUGIN_URL') )164 if ( ! defined( 'WP_PLUGIN_URL' ) ) { 155 165 define( 'WP_PLUGIN_URL', WP_CONTENT_URL . '/plugins' ); // full url, no trailing slash 166 } 156 167 157 168 /** … … 161 172 * @deprecated 162 173 */ 163 if ( ! defined('PLUGINDIR') )174 if ( ! defined( 'PLUGINDIR' ) ) { 164 175 define( 'PLUGINDIR', 'wp-content/plugins' ); // Relative to ABSPATH. For back compat. 176 } 165 177 166 178 /** … … 169 181 * @since 2.8.0 170 182 */ 171 if ( ! defined('WPMU_PLUGIN_DIR') )183 if ( ! defined( 'WPMU_PLUGIN_DIR' ) ) { 172 184 define( 'WPMU_PLUGIN_DIR', WP_CONTENT_DIR . '/mu-plugins' ); // full path, no trailing slash 185 } 173 186 174 187 /** … … 177 190 * @since 2.8.0 178 191 */ 179 if ( ! defined('WPMU_PLUGIN_URL') )192 if ( ! defined( 'WPMU_PLUGIN_URL' ) ) { 180 193 define( 'WPMU_PLUGIN_URL', WP_CONTENT_URL . '/mu-plugins' ); // full url, no trailing slash 194 } 181 195 182 196 /** … … 186 200 * @deprecated 187 201 */ 188 if ( ! defined( 'MUPLUGINDIR' ) )202 if ( ! defined( 'MUPLUGINDIR' ) ) { 189 203 define( 'MUPLUGINDIR', 'wp-content/mu-plugins' ); // Relative to ABSPATH. For back compat. 204 } 190 205 } 191 206 … … 194 209 * 195 210 * Defines constants after multisite is loaded. 211 * 196 212 * @since 3.0.0 197 213 */ … … 202 218 * @since 1.5.0 203 219 */ 204 if ( ! defined( 'COOKIEHASH' ) ) {220 if ( ! defined( 'COOKIEHASH' ) ) { 205 221 $siteurl = get_site_option( 'siteurl' ); 206 if ( $siteurl ) 222 if ( $siteurl ) { 207 223 define( 'COOKIEHASH', md5( $siteurl ) ); 208 else224 } else { 209 225 define( 'COOKIEHASH', '' ); 226 } 210 227 } 211 228 … … 213 230 * @since 2.0.0 214 231 */ 215 if ( !defined('USER_COOKIE') ) 216 define('USER_COOKIE', 'wordpressuser_' . COOKIEHASH); 232 if ( ! defined( 'USER_COOKIE' ) ) { 233 define( 'USER_COOKIE', 'wordpressuser_' . COOKIEHASH ); 234 } 217 235 218 236 /** 219 237 * @since 2.0.0 220 238 */ 221 if ( !defined('PASS_COOKIE') ) 222 define('PASS_COOKIE', 'wordpresspass_' . COOKIEHASH); 239 if ( ! defined( 'PASS_COOKIE' ) ) { 240 define( 'PASS_COOKIE', 'wordpresspass_' . COOKIEHASH ); 241 } 223 242 224 243 /** 225 244 * @since 2.5.0 226 245 */ 227 if ( !defined('AUTH_COOKIE') ) 228 define('AUTH_COOKIE', 'wordpress_' . COOKIEHASH); 229 230 /** 231 * @since 2.6.0 232 */ 233 if ( !defined('SECURE_AUTH_COOKIE') ) 234 define('SECURE_AUTH_COOKIE', 'wordpress_sec_' . COOKIEHASH); 235 236 /** 237 * @since 2.6.0 238 */ 239 if ( !defined('LOGGED_IN_COOKIE') ) 240 define('LOGGED_IN_COOKIE', 'wordpress_logged_in_' . COOKIEHASH); 246 if ( ! defined( 'AUTH_COOKIE' ) ) { 247 define( 'AUTH_COOKIE', 'wordpress_' . COOKIEHASH ); 248 } 249 250 /** 251 * @since 2.6.0 252 */ 253 if ( ! defined( 'SECURE_AUTH_COOKIE' ) ) { 254 define( 'SECURE_AUTH_COOKIE', 'wordpress_sec_' . COOKIEHASH ); 255 } 256 257 /** 258 * @since 2.6.0 259 */ 260 if ( ! defined( 'LOGGED_IN_COOKIE' ) ) { 261 define( 'LOGGED_IN_COOKIE', 'wordpress_logged_in_' . COOKIEHASH ); 262 } 241 263 242 264 /** 243 265 * @since 2.3.0 244 266 */ 245 if ( !defined('TEST_COOKIE') ) 246 define('TEST_COOKIE', 'wordpress_test_cookie'); 267 if ( ! defined( 'TEST_COOKIE' ) ) { 268 define( 'TEST_COOKIE', 'wordpress_test_cookie' ); 269 } 247 270 248 271 /** 249 272 * @since 1.2.0 250 273 */ 251 if ( !defined('COOKIEPATH') ) 252 define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('home') . '/' ) ); 274 if ( ! defined( 'COOKIEPATH' ) ) { 275 define( 'COOKIEPATH', preg_replace( '|https?://[^/]+|i', '', get_option( 'home' ) . '/' ) ); 276 } 253 277 254 278 /** 255 279 * @since 1.5.0 256 280 */ 257 if ( !defined('SITECOOKIEPATH') ) 258 define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_option('siteurl') . '/' ) ); 259 260 /** 261 * @since 2.6.0 262 */ 263 if ( !defined('ADMIN_COOKIE_PATH') ) 281 if ( ! defined( 'SITECOOKIEPATH' ) ) { 282 define( 'SITECOOKIEPATH', preg_replace( '|https?://[^/]+|i', '', get_option( 'siteurl' ) . '/' ) ); 283 } 284 285 /** 286 * @since 2.6.0 287 */ 288 if ( ! defined( 'ADMIN_COOKIE_PATH' ) ) { 264 289 define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . 'wp-admin' ); 265 266 /** 267 * @since 2.6.0 268 */ 269 if ( !defined('PLUGINS_COOKIE_PATH') ) 270 define( 'PLUGINS_COOKIE_PATH', preg_replace('|https?://[^/]+|i', '', WP_PLUGIN_URL) ); 290 } 291 292 /** 293 * @since 2.6.0 294 */ 295 if ( ! defined( 'PLUGINS_COOKIE_PATH' ) ) { 296 define( 'PLUGINS_COOKIE_PATH', preg_replace( '|https?://[^/]+|i', '', WP_PLUGIN_URL ) ); 297 } 271 298 272 299 /** 273 300 * @since 2.0.0 274 301 */ 275 if ( !defined('COOKIE_DOMAIN') ) 276 define('COOKIE_DOMAIN', false); 302 if ( ! defined( 'COOKIE_DOMAIN' ) ) { 303 define( 'COOKIE_DOMAIN', false ); 304 } 277 305 } 278 306 … … 286 314 * @since 2.6.0 287 315 */ 288 if ( ! defined( 'FORCE_SSL_ADMIN' ) ) {316 if ( ! defined( 'FORCE_SSL_ADMIN' ) ) { 289 317 if ( 'https' === parse_url( get_option( 'siteurl' ), PHP_URL_SCHEME ) ) { 290 318 define( 'FORCE_SSL_ADMIN', true ); … … 313 341 * @since 2.5.0 314 342 */ 315 if ( ! defined( 'AUTOSAVE_INTERVAL' ) )343 if ( ! defined( 'AUTOSAVE_INTERVAL' ) ) { 316 344 define( 'AUTOSAVE_INTERVAL', 60 ); 345 } 317 346 318 347 /** 319 348 * @since 2.9.0 320 349 */ 321 if ( ! defined( 'EMPTY_TRASH_DAYS' ) )350 if ( ! defined( 'EMPTY_TRASH_DAYS' ) ) { 322 351 define( 'EMPTY_TRASH_DAYS', 30 ); 323 324 if ( !defined('WP_POST_REVISIONS') ) 325 define('WP_POST_REVISIONS', true); 352 } 353 354 if ( ! defined( 'WP_POST_REVISIONS' ) ) { 355 define( 'WP_POST_REVISIONS', true ); 356 } 326 357 327 358 /** 328 359 * @since 3.3.0 329 360 */ 330 if ( !defined( 'WP_CRON_LOCK_TIMEOUT' ) ) 331 define('WP_CRON_LOCK_TIMEOUT', 60); // In seconds 361 if ( ! defined( 'WP_CRON_LOCK_TIMEOUT' ) ) { 362 define( 'WP_CRON_LOCK_TIMEOUT', 60 ); // In seconds 363 } 332 364 } 333 365 … … 340 372 /** 341 373 * Filesystem path to the current active template directory 374 * 342 375 * @since 1.5.0 343 376 */ 344 define( 'TEMPLATEPATH', get_template_directory());377 define( 'TEMPLATEPATH', get_template_directory() ); 345 378 346 379 /** 347 380 * Filesystem path to the current active template stylesheet directory 381 * 348 382 * @since 2.1.0 349 383 */ 350 define( 'STYLESHEETPATH', get_stylesheet_directory());384 define( 'STYLESHEETPATH', get_stylesheet_directory() ); 351 385 352 386 /** … … 358 392 * @see WP_Theme::get_core_default_theme() 359 393 */ 360 if ( ! defined('WP_DEFAULT_THEME') )394 if ( ! defined( 'WP_DEFAULT_THEME' ) ) { 361 395 define( 'WP_DEFAULT_THEME', 'twentyseventeen' ); 362 363 } 396 } 397 398 }
Note: See TracChangeset
for help on using the changeset viewer.