get_block_template

过滤钩子
apply_filters( 'get_block_template', $block_template, $id, $template_type )
参数
  • (WP_Block_Template|null) $block_template The found block template, or null if there isn't one.
    Required:
  • (string) $id Template unique identifier (example: theme_slug//template_slug).
    Required:
  • (array) $template_type Template type: `'wp_template'` or '`wp_template_part'`.
    Required:
定义位置
相关勾子
get_block_templatespre_get_block_templateget_block_file_templatepre_get_block_templatespre_get_block_file_template
相关方法
get_block_templateget_block_templatesget_block_file_template_get_block_template_filelocate_block_template_get_block_templates_files
引入
5.9.0
弃用
-

get_block_template: 这个函数检索用于渲染块类型的模板的路径: 该函数将块类型的名称作为参数,并返回模板的路径。

获取查询的块模板对象后,对其进行过滤。

return apply_filters( 'get_block_template', $block_template, $id, $template_type );

常见问题

FAQs
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2025-12-13 17:36:12

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: