render_block_core_template_part_post

動作鉤子
do_action( 'render_block_core_template_part_post', $template_part_id, $attributes, $template_part_post, $content )
引數
  • (string) $template_part_id The requested template part namespaced to the theme.
    Required:
  • (array) $attributes The block attributes.
    Required:
  • (WP_Post) $template_part_post The template part post object.
    Required:
  • (string) $content The template part content.
    Required:
定義位置
相關勾子
render_block_core_template_part_nonerender_block_core_template_part_filepre_get_block_templatesrender_block_contextpre_get_block_file_template
相關方法
render_block_core_template_partrender_block_core_latest_postsregister_block_core_template_partrender_block_core_post_templateregister_block_core_latest_postsrender_block_core_comment_template
引入
5.9.0
棄用
-

render_block_core_template_part_post。這個過濾器鉤子用於修改在渲染一個塊時傳遞給核心模板部分的文章資料。這在你想新增額外的資料或在傳遞給模板之前修改文章資料的情況下很有用。

當一個區塊模板部分從儲存在資料庫中的模板文章中載入時,會發生觸發。

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

常見問題

FAQs
檢視更多 >