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: 這個函式檢索用於渲染一個塊型別的所有模板的路徑: 該函式將塊型別的名稱作為引數,並返回一個模板的路徑陣列。

過濾已獲取的區塊模板陣列,在它們被獲取後。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
return apply_filters( 'get_block_templates', $query_result, $query, $template_type );
return apply_filters( 'get_block_templates', $query_result, $query, $template_type );
return apply_filters( 'get_block_templates', $query_result, $query, $template_type );

常見問題

FAQs
檢視更多 >