get_current_blog_id

函式
get_current_blog_id ( No parameters )
返回值
  • (int) Site ID.
定義位置
相關方法
get_current_user_idget_current_network_idrestore_current_blogget_current_siteget_comment_guid
引入
3.1.0
棄用
-

get_current_blog_id: 這個函式返回WordPress多站點網路中當前站點的ID。在處理需要區分不同站點的多站點特定程式碼時,它很有用。

檢索當前站點的ID。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function get_current_blog_id() {
global $blog_id;
return absint( $blog_id );
}
function get_current_blog_id() { global $blog_id; return absint( $blog_id ); }
function get_current_blog_id() {
	global $blog_id;
	return absint( $blog_id );
}

常見問題

FAQs
檢視更多 >