wp_installing

函式
wp_installing ( $is_installing = null )
引數
  • (bool) $is_installing Optional. True to set WP into Installing mode, false to turn Installing mode off. Omit this parameter if you only want to fetch the current status.
    Required:
    Default: null
返回值
  • (bool) True if WP is installing, otherwise false. When a `$is_installing` is passed, the function will report whether WP was in installing mode prior to the change to `$is_installing`.
定義位置
相關方法
wp_installwp_insert_linkwp_ajax_install_pluginwp_not_installedwp_star_rating
引入
4.4.0
棄用
-

wp_installing: 這個函式用來檢查WordPress當前是否正在安裝。

檢查或設定WordPress是否處於"安裝"模式。

如果在引導過程中定義了`WP_INSTALLING`常量,`wp_installing()`將預設為`true`。

function wp_installing( $is_installing = null ) {
	static $installing = null;

	// Support for the `WP_INSTALLING` constant, defined before WP is loaded.
	if ( is_null( $installing ) ) {
		$installing = defined( 'WP_INSTALLING' ) && WP_INSTALLING;
	}

	if ( ! is_null( $is_installing ) ) {
		$old_installing = $installing;
		$installing     = $is_installing;
		return (bool) $old_installing;
	}

	return (bool) $installing;
}

常見問題

FAQs
檢視更多 >