WordPress.org

Make WordPress Core

Ticket #31130: 31130.5.diff

File 31130.5.diff, 2.8 KB (added by adamsilverstein, 6 years ago)
  • src/wp-includes/functions.php

     
    12601260}
    12611261
    12621262/**
    1263  * Check or set whether WordPress is in "installation" mode.
    1264  *
    1265  * If the `WP_INSTALLING` constant is defined during the bootstrap, `wp_installing()` will default to `true`.
    1266  *
    1267  * @since 4.4.0
    1268  *
    1269  * @staticvar bool $installing
    1270  *
    1271  * @param bool $is_installing Optional. True to set WP into Installing mode, false to turn Installing mode off.
    1272  *                            Omit this parameter if you only want to fetch the current status.
    1273  * @return bool True if WP is installing, otherwise false. When a `$is_installing` is passed, the function will
    1274  *              report whether WP was in installing mode prior to the change to `$is_installing`.
    1275  */
    1276 function wp_installing( $is_installing = null ) {
    1277         static $installing = null;
    1278 
    1279         // Support for the `WP_INSTALLING` constant, defined before WP is loaded.
    1280         if ( is_null( $installing ) ) {
    1281                 $installing = defined( 'WP_INSTALLING' ) && WP_INSTALLING;
    1282         }
    1283 
    1284         if ( ! is_null( $is_installing ) ) {
    1285                 $old_installing = $installing;
    1286                 $installing = $is_installing;
    1287                 return (bool) $old_installing;
    1288         }
    1289 
    1290         return (bool) $installing;
    1291 }
    1292 
    1293 /**
    12941263 * Test whether blog is already installed.
    12951264 *
    12961265 * The cache will be checked first. If you have a cache plugin, which saves
  • src/wp-includes/load.php

     
    841841
    842842        $wp_locale = new WP_Locale();
    843843}
     844
     845/**
     846 * Check or set whether WordPress is in "installation" mode.
     847 *
     848 * If the `WP_INSTALLING` constant is defined during the bootstrap, `wp_installing()` will default to `true`.
     849 *
     850 * @since 4.4.0
     851 *
     852 * @staticvar bool $installing
     853 *
     854 * @param bool $is_installing Optional. True to set WP into Installing mode, false to turn Installing mode off.
     855 *                            Omit this parameter if you only want to fetch the current status.
     856 * @return bool True if WP is installing, otherwise false. When a `$is_installing` is passed, the function will
     857 *              report whether WP was in installing mode prior to the change to `$is_installing`.
     858 */
     859function wp_installing( $is_installing = null ) {
     860        static $installing = null;
     861
     862        // Support for the `WP_INSTALLING` constant, defined before WP is loaded.
     863        if ( is_null( $installing ) ) {
     864                $installing = defined( 'WP_INSTALLING' ) && WP_INSTALLING;
     865        }
     866
     867        if ( ! is_null( $is_installing ) ) {
     868                $old_installing = $installing;
     869                $installing = $is_installing;
     870                return (bool) $old_installing;
     871        }
     872
     873        return (bool) $installing;
     874}