wp_is_block_theme

函式
wp_is_block_theme ( No parameters )
返回值
  • (bool) Whether the active theme is a block-based theme or not.
定義位置
相關方法
wp_enable_block_templatesis_child_themeget_block_templatewp_using_themeswp_is_stream
引入
5.9.0
棄用
-

wp_is_block_theme: 這個函式用來檢查當前的主題是否是WordPress中的一個區塊主題。區塊主題是一種新的主題型別,它被設計為與區塊編輯器無縫地工作。

返回活動主題是否是一個基於區塊的主題。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function wp_is_block_theme() {
return wp_get_theme()->is_block_theme();
}
function wp_is_block_theme() { return wp_get_theme()->is_block_theme(); }
function wp_is_block_theme() {
	return wp_get_theme()->is_block_theme();
}

常見問題

FAQs
檢視更多 >