\TriTan\Interfaces\HooksActionFilterHookInterface

Summary

Methods
Constants
addAction()
removeAction()
addFilter()
removeFilter()
applyFilter()
doAction()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

addAction()

addAction(string  $hook, callback  $function_to_add, integer  $priority = 10, integer  $accepted_args = 1) 

Add a new action to the collection to be registered with TriTan CMS.

Parameters

string $hook

The name of the TriTan CMS action that is being registered.

callback $function_to_add

The name of the function/method that is to be called.

integer $priority

Optional. The priority at which the function should be fired. Default is 10.

integer $accepted_args

Optional. The number of arguments that should be passed to the $callback. Default is 1.

removeAction()

removeAction(string  $hook, callback  $function_to_remove, integer  $priority = 10) : boolean

Removes a function/method from a specified action hook.

Parameters

string $hook

The action hook to which the function/method to be removed is hooked.

callback $function_to_remove

The name of the function/method which should be removed.

integer $priority

optional The priority of the function/method (default: 10).

Returns

boolean —

Whether the function/method is removed.

addFilter()

addFilter(string  $hook, callback  $function_to_add, integer  $priority = 10, integer  $accepted_args = 1) 

Registers a filtering function

Parameters

string $hook

The name of the element to be filtered or action to be triggered

callback $function_to_add

The name of the function/method that is to be called.

integer $priority

Optional. Used to specify the order in which the functions associated with a particular action are executed (default=10, lower=earlier execution, and functions with the same priority are executed in the order in which they were added to the filter)

integer $accepted_args

Optional. The number of arguments the function accept (default is the number provided).

removeFilter()

removeFilter(string  $hook, callback  $function_to_remove, integer  $priority = 10) : boolean

Removes a function from a specified filter hook.

This function removes a function attached to a specified filter hook. This method can be used to remove default functions attached to a specific filter hook and possibly replace them with a substitute.

To remove a hook, the $function_to_remove and $priority arguments must match when the hook was added.

Parameters

string $hook

The filter hook to which the function to be removed is hooked.

callback $function_to_remove

The name of the function which should be removed.

integer $priority

optional. The priority of the function (default: 10).

Returns

boolean —

Whether the function was registered as a filter before it was removed.

applyFilter()

applyFilter(string  $hook, mixed  $value) : mixed

Performs a filtering operation on a PM element or event.

Returns an element which may have been filtered by a filter.

Parameters

string $hook

The name of the the element or action

mixed $value

The value of the element before filtering

Returns

mixed

doAction()

doAction(string  $hook, mixed  $arg = '') 

Execute functions/methods hooked on a specific action hook.

Parameters

string $hook

The name of the action to be executed.

mixed $arg

Optional. Additional arguments which are passed on to the functions/methods hooked to the action. Default empty.