Make WordPress Core


Ignore:
Timestamp:
08/20/2022 12:30:54 AM (22 months ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/load.php

    r53884 r53915  
    769769 */
    770770function wp_not_installed() {
     771    if ( is_blog_installed() || wp_installing() ) {
     772        return;
     773    }
     774
     775    nocache_headers();
     776
    771777    if ( is_multisite() ) {
    772         if ( ! is_blog_installed() && ! wp_installing() ) {
    773             nocache_headers();
    774 
    775             wp_die( __( 'The site you have requested is not installed properly. Please contact the system administrator.' ) );
    776         }
    777     } elseif ( ! is_blog_installed() && ! wp_installing() ) {
    778         nocache_headers();
    779 
    780         require ABSPATH . WPINC . '/kses.php';
    781         require ABSPATH . WPINC . '/pluggable.php';
    782 
    783         $link = wp_guess_url() . '/wp-admin/install.php';
    784 
    785         wp_redirect( $link );
    786         die();
    787     }
     778        wp_die( __( 'The site you have requested is not installed properly. Please contact the system administrator.' ) );
     779    }
     780
     781    require ABSPATH . WPINC . '/kses.php';
     782    require ABSPATH . WPINC . '/pluggable.php';
     783
     784    $link = wp_guess_url() . '/wp-admin/install.php';
     785
     786    wp_redirect( $link );
     787    die();
    788788}
    789789
Note: See TracChangeset for help on using the changeset viewer.