doing_filter()

最后更新于:2021-11-26 02:39:19

doing_filter( null|string$hook_name=null)

响应s whether or not a filter hook is currently being processed.

参数

$hook_name

(null|string) (Optional) Filter hook to check. Defaults to null, which checks if any filter is currently being run.

Default value: null

响应

(bool) Whether the filter is currently in the stack.

源文件

文件: gc-includes/plugin.php

function doing_filter( $hook_name = null ) {
	global $gc_current_filter;

	if ( null === $hook_name ) {
		return ! empty( $gc_current_filter );
	}

	return in_array( $hook_name, $gc_current_filter, true );
}