如果未安装WordPress,则重定向到安装程序。

原型

wp_not_installed()

描述

启用多站点时,将显示错误消息。

源文件

路径:wp-includes/load.php

<?php
...
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' );
		require( ABSPATH . WPINC . '/formatting.php' );
		$link = wp_guess_url() . '/wp-admin/install.php';
		wp_redirect( $link );
		die();
	}
}
...
?>

其他

英文文档:https://developer.wordpress.org/reference/functions/wp_not_installed/