get_block_templates

过滤钩子
apply_filters( 'get_block_templates', $query_result, $query, $template_type )
参数
  • (WP_Block_Template[]) $query_result Array of found block templates.
    Required:
  • (array) $query { Optional. Arguments to retrieve templates. @type array $slug__in List of slugs to include. @type int $wp_id Post ID of customized template. }
    Required:
  • (string) $template_type wp_template or wp_template_part.
    Required:
定义位置
相关勾子
get_block_templatepre_get_block_templatespre_get_block_templateget_block_file_templatepre_get_block_file_template
相关方法
get_block_templatesget_block_templateget_block_file_template_get_block_templates_files_get_block_templates_paths_get_block_template_file
引入
5.9.0
弃用
-

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

过滤已获取的区块模板数组,在它们被获取后。

return apply_filters( 'get_block_templates', $query_result, $query, $template_type );

常见问题

FAQs
查看更多 >
闪电侠

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

2025-12-14 15:36:34

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

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

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