template_redirect

動作鉤子
do_action( 'template_redirect' )

template_redirect – 這個動作在模板檔案被選中後,在模板檔案被收錄前執行。這個動作通常用於將使用者重定向到另一個頁面,或者在模板檔案被載入之前執行其他動作。

在確定載入哪種模板之前,先觸發。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
do_action( 'template_redirect' );
do_action( 'template_redirect' );
do_action( 'template_redirect' );

常見問題

FAQs
檢視更多 >