問題描述

在解決 this question 之後,要獲得一個功能,在 init 操作被觸發之前,透過將序列從其功能中觸發,它讓我想起來,WP 載入序列中有沒有可以掛接一個函式?

最佳解決方案

muplugins_loaded 是最早的掛鉤。

Depending on your wordpress setup, you may not have any plugins in the MU_PLUGINS directory. In that case this hook may not fire.

觸發的最佳鉤子是 plugins_loaded

資源

  1. WordPress Codex – Action Reference List

  2. Q /A:How to get WordPress’ hook run sequence?

  3. Q /A:Make sense of WP Load Core

參考文獻

注:本文內容整合自 Google/Baidu/Bing 輔助翻譯的英文資料結果。如果您對結果不滿意,可以加入我們改善翻譯效果:薇曉朵技術論壇。