wp/wp-includes/default-constants.php
changeset 21 48c4eec2b7e6
parent 19 3d72ae0968f4
child 22 8c2e4d02f4ef
equal deleted inserted replaced
20:7b1b88e27a20 21:48c4eec2b7e6
    75 
    75 
    76 	if ( ! defined( 'WP_CONTENT_DIR' ) ) {
    76 	if ( ! defined( 'WP_CONTENT_DIR' ) ) {
    77 		define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); // No trailing slash, full paths only - WP_CONTENT_URL is defined further down.
    77 		define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); // No trailing slash, full paths only - WP_CONTENT_URL is defined further down.
    78 	}
    78 	}
    79 
    79 
       
    80 	/*
       
    81 	 * Add define( 'WP_DEVELOPMENT_MODE', 'core' ), or define( 'WP_DEVELOPMENT_MODE', 'plugin' ), or
       
    82 	 * define( 'WP_DEVELOPMENT_MODE', 'theme' ), or define( 'WP_DEVELOPMENT_MODE', 'all' ) to wp-config.php
       
    83 	 * to signify development mode for WordPress core, a plugin, a theme, or all three types respectively.
       
    84 	 */
       
    85 	if ( ! defined( 'WP_DEVELOPMENT_MODE' ) ) {
       
    86 		define( 'WP_DEVELOPMENT_MODE', '' );
       
    87 	}
       
    88 
    80 	// Add define( 'WP_DEBUG', true ); to wp-config.php to enable display of notices during development.
    89 	// Add define( 'WP_DEBUG', true ); to wp-config.php to enable display of notices during development.
    81 	if ( ! defined( 'WP_DEBUG' ) ) {
    90 	if ( ! defined( 'WP_DEBUG' ) ) {
    82 		if ( 'development' === wp_get_environment_type() ) {
    91 		if ( wp_get_development_mode() || 'development' === wp_get_environment_type() ) {
    83 			define( 'WP_DEBUG', true );
    92 			define( 'WP_DEBUG', true );
    84 		} else {
    93 		} else {
    85 			define( 'WP_DEBUG', false );
    94 			define( 'WP_DEBUG', false );
    86 		}
    95 		}
    87 	}
    96 	}
    88 
    97 
    89 	// Add define( 'WP_DEBUG_DISPLAY', null ); to wp-config.php to use the globally configured setting
    98 	/*
    90 	// for 'display_errors' and not force errors to be displayed. Use false to force 'display_errors' off.
    99 	 * Add define( 'WP_DEBUG_DISPLAY', null ); to wp-config.php to use the globally configured setting
       
   100 	 * for 'display_errors' and not force errors to be displayed. Use false to force 'display_errors' off.
       
   101 	 */
    91 	if ( ! defined( 'WP_DEBUG_DISPLAY' ) ) {
   102 	if ( ! defined( 'WP_DEBUG_DISPLAY' ) ) {
    92 		define( 'WP_DEBUG_DISPLAY', true );
   103 		define( 'WP_DEBUG_DISPLAY', true );
    93 	}
   104 	}
    94 
   105 
    95 	// Add define( 'WP_DEBUG_LOG', true ); to enable error logging to wp-content/debug.log.
   106 	// Add define( 'WP_DEBUG_LOG', true ); to enable error logging to wp-content/debug.log.
    99 
   110 
   100 	if ( ! defined( 'WP_CACHE' ) ) {
   111 	if ( ! defined( 'WP_CACHE' ) ) {
   101 		define( 'WP_CACHE', false );
   112 		define( 'WP_CACHE', false );
   102 	}
   113 	}
   103 
   114 
   104 	// Add define( 'SCRIPT_DEBUG', true ); to wp-config.php to enable loading of non-minified,
   115 	/*
   105 	// non-concatenated scripts and stylesheets.
   116 	 * Add define( 'SCRIPT_DEBUG', true ); to wp-config.php to enable loading of non-minified,
       
   117 	 * non-concatenated scripts and stylesheets.
       
   118 	 */
   106 	if ( ! defined( 'SCRIPT_DEBUG' ) ) {
   119 	if ( ! defined( 'SCRIPT_DEBUG' ) ) {
   107 		if ( ! empty( $wp_version ) ) {
   120 		if ( ! empty( $wp_version ) ) {
   108 			$develop_src = false !== strpos( $wp_version, '-src' );
   121 			$develop_src = str_contains( $wp_version, '-src' );
   109 		} else {
   122 		} else {
   110 			$develop_src = false;
   123 			$develop_src = false;
   111 		}
   124 		}
   112 
   125 
   113 		define( 'SCRIPT_DEBUG', $develop_src );
   126 		define( 'SCRIPT_DEBUG', $develop_src );
   310 		define( 'PLUGINS_COOKIE_PATH', preg_replace( '|https?://[^/]+|i', '', WP_PLUGIN_URL ) );
   323 		define( 'PLUGINS_COOKIE_PATH', preg_replace( '|https?://[^/]+|i', '', WP_PLUGIN_URL ) );
   311 	}
   324 	}
   312 
   325 
   313 	/**
   326 	/**
   314 	 * @since 2.0.0
   327 	 * @since 2.0.0
       
   328 	 * @since 6.6.0 The value has changed from false to an empty string.
   315 	 */
   329 	 */
   316 	if ( ! defined( 'COOKIE_DOMAIN' ) ) {
   330 	if ( ! defined( 'COOKIE_DOMAIN' ) ) {
   317 		define( 'COOKIE_DOMAIN', false );
   331 		define( 'COOKIE_DOMAIN', '' );
   318 	}
   332 	}
   319 
   333 
   320 	if ( ! defined( 'RECOVERY_MODE_COOKIE' ) ) {
   334 	if ( ! defined( 'RECOVERY_MODE_COOKIE' ) ) {
   321 		/**
   335 		/**
   322 		 * @since 5.2.0
   336 		 * @since 5.2.0
   392 function wp_templating_constants() {
   406 function wp_templating_constants() {
   393 	/**
   407 	/**
   394 	 * Filesystem path to the current active template directory.
   408 	 * Filesystem path to the current active template directory.
   395 	 *
   409 	 *
   396 	 * @since 1.5.0
   410 	 * @since 1.5.0
       
   411 	 * @deprecated 6.4.0 Use get_template_directory() instead.
       
   412 	 * @see get_template_directory()
   397 	 */
   413 	 */
   398 	define( 'TEMPLATEPATH', get_template_directory() );
   414 	define( 'TEMPLATEPATH', get_template_directory() );
   399 
   415 
   400 	/**
   416 	/**
   401 	 * Filesystem path to the current active template stylesheet directory.
   417 	 * Filesystem path to the current active template stylesheet directory.
   402 	 *
   418 	 *
   403 	 * @since 2.1.0
   419 	 * @since 2.1.0
       
   420 	 * @deprecated 6.4.0 Use get_stylesheet_directory() instead.
       
   421 	 * @see get_stylesheet_directory()
   404 	 */
   422 	 */
   405 	define( 'STYLESHEETPATH', get_stylesheet_directory() );
   423 	define( 'STYLESHEETPATH', get_stylesheet_directory() );
   406 
   424 
   407 	/**
   425 	/**
   408 	 * Slug of the default theme for this installation.
   426 	 * Slug of the default theme for this installation.
   412 	 * @since 3.0.0
   430 	 * @since 3.0.0
   413 	 *
   431 	 *
   414 	 * @see WP_Theme::get_core_default_theme()
   432 	 * @see WP_Theme::get_core_default_theme()
   415 	 */
   433 	 */
   416 	if ( ! defined( 'WP_DEFAULT_THEME' ) ) {
   434 	if ( ! defined( 'WP_DEFAULT_THEME' ) ) {
   417 		define( 'WP_DEFAULT_THEME', 'twentytwentytwo' );
   435 		define( 'WP_DEFAULT_THEME', 'twentytwentyfour' );
   418 	}
   436 	}
   419 
   437 }
   420 }