WooCommerce Code Reference

ActionsProxy
in package

Proxy for interacting with WordPress actions and filters.

This class should be used instead of directly accessing the WordPress functions, to ease unit testing.

Table of Contents

apply_filters()  : mixed
Calls the callback functions that have been added to a filter hook.
did_action()  : int
Retrieve the number of times an action is fired.

Methods

apply_filters()

Calls the callback functions that have been added to a filter hook.

public apply_filters(string $tag, mixed $value, mixed ...$parameters) : mixed
Parameters
$tag : string

The name of the filter hook.

$value : mixed

The value to filter.

$parameters : mixed

Additional parameters to pass to the callback functions.

Return values
mixedThe filtered value after all hooked functions are applied to it.

did_action()

Retrieve the number of times an action is fired.

public did_action(string $tag) : int
Parameters
$tag : string

The name of the action hook.

Return values
intThe number of times action hook $tag is fired.