doing_action

函式
doing_action ( $hook_name = null )
引數
  • (string|null) $hook_name Optional. Action hook to check. Defaults to null, which checks if any action is currently being run.
    Required:
    Default: null
返回值
  • (bool) Whether the action is currently in the stack.
相關
  • current_action()
  • did_action()
定義位置
相關方法
do_actiondid_actionadd_actionwp_doing_crondo_settings_sections
引入
3.9.0
棄用
-

doing_action: 這是一個WordPress的動作,當一個特定的動作被執行時就會被觸發。開發人員可以使用這個動作在WordPress的執行過程中的特定點上執行程式碼。

返回當前是否正在處理一個動作鉤子。

函式current_action()只返回最近正在執行的動作。 did_action()返回在當前請求中一個動作被觸發的次數。

這個函式允許對當前正在執行的任何動作(不管它是否是最近的動作,在從鉤子回撥中呼叫的鉤子的情況下)的檢測進行驗證。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function doing_action( $hook_name = null ) {
return doing_filter( $hook_name );
}
function doing_action( $hook_name = null ) { return doing_filter( $hook_name ); }
function doing_action( $hook_name = null ) {
	return doing_filter( $hook_name );
}

常見問題

FAQs
檢視更多 >