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. git-svn-id: https://develop.svn.wordpress.org/trunk@34896 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
7665377058
commit
7cfee3c41d
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user