Documentation
Documentation
Graphic_Data_Loader
in package
Register all actions and filters for the plugin.
Maintain a list of all hooks that are registered throughout the plugin, and register them with the WordPress API. Call the run function to execute the list of actions and filters.
Table of Contents
Properties
- $actions : array<string|int, mixed>
- The array of actions registered with WordPress.
- $filters : array<string|int, mixed>
- The array of filters registered with WordPress.
Methods
- __construct() : mixed
- Initialize the collections used to maintain the actions and filters.
- add_action() : mixed
- Add a new action to the collection to be registered with WordPress.
- add_filter() : mixed
- Add a new filter to the collection to be registered with WordPress.
- run() : mixed
- Register the filters and actions with WordPress.
- add() : array<string|int, mixed>
- A utility function that is used to register the actions and hooks into a single collection.
Properties
$actions
The array of actions registered with WordPress.
protected
array<string|int, mixed>
$actions
The actions registered with WordPress to fire when the plugin loads.
Tags
$filters
The array of filters registered with WordPress.
protected
array<string|int, mixed>
$filters
The filters registered with WordPress to fire when the plugin loads.
Tags
Methods
__construct()
Initialize the collections used to maintain the actions and filters.
public
__construct() : mixed
Tags
add_action()
Add a new action to the collection to be registered with WordPress.
public
add_action(string $hook, object $component, string $callback[, int $priority = 10 ][, int $accepted_args = 1 ]) : mixed
Parameters
- $hook : string
-
The name of the WordPress action that is being registered.
- $component : object
-
A reference to the instance of the object on which the action is defined.
- $callback : string
-
The name of the function definition on the $component.
- $priority : int = 10
-
Optional. The priority at which the function should be fired. Default is 10.
- $accepted_args : int = 1
-
Optional. The number of arguments that should be passed to the $callback. Default is 1.
Tags
add_filter()
Add a new filter to the collection to be registered with WordPress.
public
add_filter(string $hook, object $component, string $callback[, int $priority = 10 ][, int $accepted_args = 1 ]) : mixed
Parameters
- $hook : string
-
The name of the WordPress filter that is being registered.
- $component : object
-
A reference to the instance of the object on which the filter is defined.
- $callback : string
-
The name of the function definition on the $component.
- $priority : int = 10
-
Optional. The priority at which the function should be fired. Default is 10.
- $accepted_args : int = 1
-
Optional. The number of arguments that should be passed to the $callback. Default is 1
Tags
run()
Register the filters and actions with WordPress.
public
run() : mixed
Tags
add()
A utility function that is used to register the actions and hooks into a single collection.
private
add(array<string|int, mixed> $hooks, string $hook, object $component, string $callback, int $priority, int $accepted_args) : array<string|int, mixed>
Parameters
- $hooks : array<string|int, mixed>
-
The collection of hooks that is being registered (that is, actions or filters).
- $hook : string
-
The name of the WordPress filter that is being registered.
- $component : object
-
A reference to the instance of the object on which the filter is defined.
- $callback : string
-
The name of the function definition on the $component.
- $priority : int
-
The priority at which the function should be fired.
- $accepted_args : int
-
The number of arguments that should be passed to the $callback.
Tags
Return values
array<string|int, mixed> —The collection of actions and filters registered with WordPress.