Improve the implementation of the default constant defining functions. See #11881.

git-svn-id: http://svn.automattic.com/wordpress/trunk@13062 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
westi 2010-02-12 07:52:58 +00:00
parent db84efc3b0
commit 52cb02ef30
1 changed files with 276 additions and 258 deletions

View File

@ -6,16 +6,12 @@
*/
/**
* Defines WordPress default constants.
* Defines initial WordPress constants
*
* @since 3.0.0
* @param $context
*/
function wp_default_constants( $context ) {
switch( $context ) {
case 'init' :
function wp_initial_constants( ) {
global $blog_id;
// set memory limits
if ( !defined('WP_MEMORY_LIMIT') ) {
@ -66,10 +62,16 @@ function wp_default_constants( $context ) {
if ( !defined('SHORTINIT') )
define('SHORTINIT', false);
break;
case 'wp_included':
}
/**
* Defines plugin directory WordPress constants
*
* Defines must-use plugin directory constants, which may be overridden in the sunrise.php drop-in
*
* @since 3.0.0
*/
function wp_plugin_directory_constants( ) {
if ( !defined('WP_CONTENT_URL') )
define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content'); // full url - WP_CONTENT_DIR is defined further up
@ -122,10 +124,15 @@ function wp_default_constants( $context ) {
*/
if ( !defined( 'MUPLUGINDIR' ) )
define( 'MUPLUGINDIR', 'wp-content/mu-plugins' ); // Relative to ABSPATH. For back compat.
break;
case 'ms_loaded';
}
/**
* Defines cookie related WordPress constants
*
* Defines constants after multisite is loaded. Cookie-related constants may be overridden in ms_network_cookies().
* @since 3.0.0
*/
function wp_cookie_constants( ) {
global $wp_default_secret_key;
/**
@ -211,7 +218,14 @@ function wp_default_constants( $context ) {
*/
if ( !defined('COOKIE_DOMAIN') )
define('COOKIE_DOMAIN', false);
}
/**
* Defines cookie related WordPress constants
*
* @since 3.0.0
*/
function wp_ssl_constants( ) {
/**
* @since 2.6.0
*/
@ -225,7 +239,14 @@ function wp_default_constants( $context ) {
if ( !defined('FORCE_SSL_LOGIN') )
define('FORCE_SSL_LOGIN', false);
force_ssl_login(FORCE_SSL_LOGIN);
}
/**
* Defines functionality related WordPress constants
*
* @since 3.0.0
*/
function wp_functionality_constants( ) {
/**
* @since 2.5.0
*/
@ -237,16 +258,17 @@ function wp_default_constants( $context ) {
*/
if ( !defined( 'EMPTY_TRASH_DAYS' ) )
define( 'EMPTY_TRASH_DAYS', 30 );
break;
case 'plugins_loaded':
if ( !defined('WP_POST_REVISIONS') )
define('WP_POST_REVISIONS', true);
break;
case 'setup_theme':
}
/**
* Defines templating related WordPress constants
*
* @since 3.0.0
*/
function wp_templating_constants( ) {
/**
* Web Path to the current active template directory
* @since 1.5.0
@ -265,10 +287,6 @@ function wp_default_constants( $context ) {
* @since 3.0.0
*/
define( 'WP_FALLBACK_THEME', 'twentyten' );
break;
}
}
?>