wp_before_load_template

動作鉤子
do_action( 'wp_before_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_after_load_templatepre_get_block_templatepre_get_block_templatesget_block_templateget_block_templates
相關方法
wp_underscore_audio_templateload_templatewp_enable_block_templateswp_underscore_video_templatewp_underscore_playlist_templateswp_maybe_load_embeds
引入
6.1.0
棄用
-

wp_before_load_template 動作是一個 WordPress 鉤子。在載入模板之前,該鉤子允許外掛或主題在載入模板之前進行操作。

在載入模板檔案之前觸發。

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

常見問題

FAQs
檢視更多 >