wp_after_load_template

動作鉤子
do_action( 'wp_after_load_template', $_template_file, $require_once, $args )
引數
  • (string) $_template_file The full path to the template file.
    Required:
  • (bool) $require_once Whether to require_once or require.
    Required:
  • (array) $args Additional arguments passed to the template.
    Required:
定義位置
相關勾子
wp_before_load_templateget_block_templatepre_get_block_templateget_block_templatespre_get_block_templates
相關方法
load_templatewp_enable_block_templateswp_underscore_audio_templatewp_maybe_load_embedswp_print_update_row_templatesget_date_template
引入
6.1.0
棄用
-

wp_after_load_template:載入並執行請求的模板後,將在 WordPress 中觸發此操作鉤子。它允許開發人員在模板載入後新增額外的處理或修改。這對於新增自定義資料、更改模板輸出或向頁面新增其他內容很有用。

在載入一個模板檔案後觸發。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
do_action( 'wp_after_load_template', $_template_file, $require_once, $args );
do_action( 'wp_after_load_template', $_template_file, $require_once, $args );
do_action( 'wp_after_load_template', $_template_file, $require_once, $args );

常見問題

FAQs
檢視更多 >