Coding Standards: Simplify the logic in `wp_not_installed()`.

The function to check whether WordPress is not installed has evolved over time, ending up with duplicate conditionals.

This commit combines two conditionals into a single one and includes an early return.

Follow-up to [672], [676], [725], [1184], [1401], [1980], [2171], [2467], [2468], [2486], [2703], [3011], [3670], [12688], [12732], [12762], [13253], [29599], [30581], [34828].

See #55647.
Built from https://develop.svn.wordpress.org/trunk@53915


git-svn-id: http://core.svn.wordpress.org/trunk@53474 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2022-08-20 00:32:10 +00:00
parent 6ceef39b2d
commit 107f660a7e
2 changed files with 17 additions and 17 deletions

View File

@ -768,23 +768,23 @@ function wp_start_object_cache() {
* @access private
*/
function wp_not_installed() {
if ( is_multisite() ) {
if ( ! is_blog_installed() && ! wp_installing() ) {
nocache_headers();
wp_die( __( 'The site you have requested is not installed properly. Please contact the system administrator.' ) );
}
} elseif ( ! is_blog_installed() && ! wp_installing() ) {
nocache_headers();
require ABSPATH . WPINC . '/kses.php';
require ABSPATH . WPINC . '/pluggable.php';
$link = wp_guess_url() . '/wp-admin/install.php';
wp_redirect( $link );
die();
if ( is_blog_installed() || wp_installing() ) {
return;
}
nocache_headers();
if ( is_multisite() ) {
wp_die( __( 'The site you have requested is not installed properly. Please contact the system administrator.' ) );
}
require ABSPATH . WPINC . '/kses.php';
require ABSPATH . WPINC . '/pluggable.php';
$link = wp_guess_url() . '/wp-admin/install.php';
wp_redirect( $link );
die();
}
/**

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.1-alpha-53914';
$wp_version = '6.1-alpha-53915';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.