From 7cfee3c41d596f8ce6b5fe8e40c735b1bd7499ba Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Wed, 7 Oct 2015 03:01:27 +0000 Subject: [PATCH] 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 --- src/wp-includes/functions.php | 31 ------------------------------- src/wp-includes/load.php | 31 +++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index 5808b29182..4a661c6b43 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -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. * diff --git a/src/wp-includes/load.php b/src/wp-includes/load.php index bd34b4dbfb..c785128aed 100644 --- a/src/wp-includes/load.php +++ b/src/wp-includes/load.php @@ -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; +}