Documentation

ActionHook
in package

ActionHook Module class.

Table of Contents

Properties

$accepted_args  : int
Number of arguments the callback accepts.
$callback  : callable
Callback function to be executed when the action hook is run.
$hook_name  : string
Action hook name.
$priority  : int
Priority of the action hook.

Methods

__construct()  : mixed
Constructor.
__toString()  : string
Custom toString magic method.
add_action()  : void
Adds the action hook to WordPress.
initialize()  : void
Initializes the action hook.

Properties

Methods

__construct()

Constructor.

public __construct(string $hook_name, callable $callback[, int $priority = 10 ][, int $accepted_args = 1 ]) : mixed

Constructs the ActionHook object by setting the hook name, callback, priority, and accepted arguments.

Parameters
$hook_name : string

Action hook name.

$callback : callable

Callback function to be executed when the action hook is run.

$priority : int = 10

Priority of the action hook.

$accepted_args : int = 1

Number of arguments the callback accepts.

Tags
since
1.0.0

__toString()

Custom toString magic method.

public __toString() : string

Returns the action hook as a JSON string.

Tags
since
1.0.0
Return values
string

JSON string.

initialize()

Initializes the action hook.

private initialize() : void

Adds the action hook to the registry.

Tags
since
1.0.0

        
On this page

Search results