wp_get_theme_data_custom_templates

函式
wp_get_theme_data_custom_templates ( No parameters )
返回值
  • (array) Associative array of `$template_name => $template_data` pairs, with `$template_data` having "title" and "postTypes" fields.
定義位置
相關方法
wp_get_theme_data_template_partswp_theme_auto_update_setting_templatewp_get_theme_directory_pattern_slugswp_print_media_templatesget_embed_template
引入
6.4.0
棄用
-

通過theme.json返回主題定義的自定義模板的後設資料。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function wp_get_theme_data_custom_templates() {
return WP_Theme_JSON_Resolver::get_theme_data( array(), array( 'with_supports' => false ) )->get_custom_templates();
}
function wp_get_theme_data_custom_templates() { return WP_Theme_JSON_Resolver::get_theme_data( array(), array( 'with_supports' => false ) )->get_custom_templates(); }
function wp_get_theme_data_custom_templates() {
	return WP_Theme_JSON_Resolver::get_theme_data( array(), array( 'with_supports' => false ) )->get_custom_templates();
}

常見問題

FAQs
檢視更多 >