Changeset 34828 for trunk/src/wp-includes/functions.php
- Timestamp:
- 10/05/2015 03:05:26 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.php
r34793 r34828 1261 1261 1262 1262 /** 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 /** 1263 1294 * Test whether blog is already installed. 1264 1295 * … … 1286 1317 1287 1318 $suppress = $wpdb->suppress_errors(); 1288 if ( ! defined( 'WP_INSTALLING') ) {1319 if ( ! wp_installing() ) { 1289 1320 $alloptions = wp_load_alloptions(); 1290 1321 } … … 3338 3369 3339 3370 // If installing or in the admin, provide the verbose message. 3340 if ( defined('WP_INSTALLING') || defined('WP_ADMIN') )3371 if ( wp_installing() || defined( 'WP_ADMIN' ) ) 3341 3372 wp_die($wpdb->error); 3342 3373
Note: See TracChangeset
for help on using the changeset viewer.