_config_wp_home

函式
_config_wp_home ( $url = '' )
Access
Private
引數
  • (string) $url URL for the home location.
    Required:
    Default: (empty)
返回值
  • (string) Homepage location.
相關
  • WP_HOME
定義位置
相關方法
_config_wp_siteurlis_homewp_shortlink_wp_head
引入
2.2.0
棄用
-

config_wp_home: 這個函式用於配置當前網站的主頁URL。它接受一個URL作為其引數,並更新網站的主頁URL選項。

檢索WordPress主頁的URL。

如果名為’WP_HOME’的常量存在,那麼它將被使用並被該函式返回。這可以用來對抗你本地開發環境中的重定向。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function _config_wp_home( $url = '' ) {
if ( defined( 'WP_HOME' ) ) {
return untrailingslashit( WP_HOME );
}
return $url;
}
function _config_wp_home( $url = '' ) { if ( defined( 'WP_HOME' ) ) { return untrailingslashit( WP_HOME ); } return $url; }
function _config_wp_home( $url = '' ) {
	if ( defined( 'WP_HOME' ) ) {
		return untrailingslashit( WP_HOME );
	}
	return $url;
}

常見問題

FAQs
檢視更多 >