From 226bb29ff0619f2502aa988e23e009ef8bd335d9 Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Wed, 7 Oct 2015 03:02:23 +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. Built from https://develop.svn.wordpress.org/trunk@34896 git-svn-id: http://core.svn.wordpress.org/trunk@34861 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 31 ------------------------------- wp-includes/load.php | 31 +++++++++++++++++++++++++++++++ wp-includes/version.php | 2 +- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 5808b29182..4a661c6b43 100644 --- a/wp-includes/functions.php +++ b/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/wp-includes/load.php b/wp-includes/load.php index bd34b4dbfb..c785128aed 100644 --- a/wp-includes/load.php +++ b/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; +} diff --git a/wp-includes/version.php b/wp-includes/version.php index 0d22e886bb..0cb790799f 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.