render_block_core_template_part_none

動作鉤子
do_action( 'render_block_core_template_part_none', $template_part_id, $attributes, $template_part_file_path )
引數
  • (string) $template_part_id The requested template part namespaced to the theme.
    Required:
  • (array) $attributes The block attributes.
    Required:
  • (string) $template_part_file_path Absolute path to the not found template path.
    Required:
定義位置
相關勾子
render_block_core_template_part_postrender_block_core_template_part_filerender_block_contextpre_get_block_file_templatepre_get_block_template
相關方法
render_block_core_template_partregister_block_core_template_partrender_block_core_post_templaterender_block_core_latest_postsrender_block_core_latest_commentsrender_block_core_comment_template
引入
5.9.0
棄用
-

render_block_core_template_part_none: 這個過濾鉤子用於確定是否應該使用一個塊的核心模板部分。這在你想為一個區塊使用自定義模板並防止使用預設模板的情況下很有用。

當請求的區塊模板部分不存在於資料庫或主題中時,就會觸發。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
do_action( 'render_block_core_template_part_none', $template_part_id, $attributes, $template_part_file_path );
do_action( 'render_block_core_template_part_none', $template_part_id, $attributes, $template_part_file_path );
do_action( 'render_block_core_template_part_none', $template_part_id, $attributes, $template_part_file_path );

常見問題

FAQs
檢視更多 >