wp_not_installed

函数
wp_not_installed ( No parameters )
Access
Private
定义位置
相关方法
ms_not_installedwp_installis_blog_installedwp_installingwp_title
引入
3.0.0
弃用
-

wp_not_installed: 这个函数检查WordPress是否安装,并返回一个布尔值来表示它是否安装。它可以用来检查是否应该根据WordPress的安装状态来启用某些功能或插件。

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

当启用多站点时,以错误信息告终。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function wp_not_installed() {
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();
}
function wp_not_installed() { 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(); }
function wp_not_installed() {
	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();
}

常见问题

FAQs
查看更多 >