Move `wp_installing()` to load.php.
Various functions in load.php need to check whether WP is in installation mode. Let's let them. Props adamsilverstein. See #31130. Built from https://develop.svn.wordpress.org/trunk@34896 git-svn-id: http://core.svn.wordpress.org/trunk@34861 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
ae813883f5
commit
226bb29ff0
|
@ -1257,37 +1257,6 @@ function do_robots() {
|
|||
echo apply_filters( 'robots_txt', $output, $public );
|
||||
}
|
||||
|
||||
/**
|
||||
* Check or set whether WordPress is in "installation" mode.
|
||||
*
|
||||
* If the `WP_INSTALLING` constant is defined during the bootstrap, `wp_installing()` will default to `true`.
|
||||
*
|
||||
* @since 4.4.0
|
||||
*
|
||||
* @staticvar bool $installing
|
||||
*
|
||||
* @param bool $is_installing Optional. True to set WP into Installing mode, false to turn Installing mode off.
|
||||
* Omit this parameter if you only want to fetch the current status.
|
||||
* @return bool True if WP is installing, otherwise false. When a `$is_installing` is passed, the function will
|
||||
* report whether WP was in installing mode prior to the change to `$is_installing`.
|
||||
*/
|
||||
function wp_installing( $is_installing = null ) {
|
||||
static $installing = null;
|
||||
|
||||
// Support for the `WP_INSTALLING` constant, defined before WP is loaded.
|
||||
if ( is_null( $installing ) ) {
|
||||
$installing = defined( 'WP_INSTALLING' ) && WP_INSTALLING;
|
||||
}
|
||||
|
||||
if ( ! is_null( $is_installing ) ) {
|
||||
$old_installing = $installing;
|
||||
$installing = $is_installing;
|
||||
return (bool) $old_installing;
|
||||
}
|
||||
|
||||
return (bool) $installing;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test whether blog is already installed.
|
||||
*
|
||||
|
|
|
@ -848,3 +848,34 @@ function wp_load_translations_early() {
|
|||
|
||||
$wp_locale = new WP_Locale();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check or set whether WordPress is in "installation" mode.
|
||||
*
|
||||
* If the `WP_INSTALLING` constant is defined during the bootstrap, `wp_installing()` will default to `true`.
|
||||
*
|
||||
* @since 4.4.0
|
||||
*
|
||||
* @staticvar bool $installing
|
||||
*
|
||||
* @param bool $is_installing Optional. True to set WP into Installing mode, false to turn Installing mode off.
|
||||
* Omit this parameter if you only want to fetch the current status.
|
||||
* @return bool True if WP is installing, otherwise false. When a `$is_installing` is passed, the function will
|
||||
* report whether WP was in installing mode prior to the change to `$is_installing`.
|
||||
*/
|
||||
function wp_installing( $is_installing = null ) {
|
||||
static $installing = null;
|
||||
|
||||
// Support for the `WP_INSTALLING` constant, defined before WP is loaded.
|
||||
if ( is_null( $installing ) ) {
|
||||
$installing = defined( 'WP_INSTALLING' ) && WP_INSTALLING;
|
||||
}
|
||||
|
||||
if ( ! is_null( $is_installing ) ) {
|
||||
$old_installing = $installing;
|
||||
$installing = $is_installing;
|
||||
return (bool) $old_installing;
|
||||
}
|
||||
|
||||
return (bool) $installing;
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.4-alpha-34895';
|
||||
$wp_version = '4.4-alpha-34896';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue