WordPress at Your Fingertips
function is not described


Hook_Manager::add_filter() public WC 1.0

Adds a filter to WordPress and registers it internally.

{} It's a method of the class: Hook_Manager{}

No Hooks.


null. Nothing.


$Hook_Manager = new Hook_Manager();
$Hook_Manager->add_filter( $tag, $callable, $priority, $accepted_args );
$tag(string) (required)
The name of the filter which is hooked.
$callable(callable) (required)
The function to call.
Used to specify the priority of the filter.
Used to specify the number of arguments the callable accepts.

Code of Hook_Manager::add_filter() WC 5.5.2

public function add_filter( $tag, $callable, $priority = 10, $accepted_args = 1 ) {
	$this->registered_hooks[ $tag ][] = array(
		'priority' => $priority,
		'callable' => $callable,

	add_filter( $tag, $callable, $priority, $accepted_args );