\O3PO_Loader

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.

Summary

Methods
Properties
Constants
__construct()
add_action()
add_filter()
run()
No public properties found
No constants found
No protected methods found
$actions
$filters
N/A
add()
No private properties found
N/A

Properties

$actions

$actions : array

The array of actions registered with WordPress.

Type

array — The actions registered with WordPress to fire when the plugin loads.

$filters

$filters : array

The array of filters registered with WordPress.

Type

array — The filters registered with WordPress to fire when the plugin loads.

Methods

__construct()

__construct() 

Initialize the collections used to maintain the actions and filters.

add_action()

add_action(string  $hook, object  $component, string  $callback, integer  $priority = 10, integer  $accepted_args = 1) 

Add a new action to the collection to be registered with WordPress.

Parameters

string $hook

The name of the WordPress action that is being registered.

object $component

A reference to the instance of the object on which the action is defined.

string $callback

The name of the function definition on the $component.

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.

add_filter()

add_filter(string  $hook, object  $component, string  $callback, integer  $priority = 10, integer  $accepted_args = 1) 

Add a new filter to the collection to be registered with WordPress.

Parameters

string $hook

The name of the WordPress filter that is being registered.

object $component

A reference to the instance of the object on which the filter is defined.

string $callback

The name of the function definition on the $component.

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

run()

run() 

Register the filters and actions with WordPress.

add()

add(array  $hooks, string  $hook, object  $component, string  $callback, integer  $priority, integer  $accepted_args) : array

A utility function that is used to register the actions and hooks into a single collection.

Parameters

array $hooks

The collection of hooks that is being registered (that is, actions or filters).

string $hook

The name of the WordPress filter that is being registered.

object $component

A reference to the instance of the object on which the filter is defined.

string $callback

The name of the function definition on the $component.

integer $priority

The priority at which the function should be fired.

integer $accepted_args

The number of arguments that should be passed to the $callback.

Returns

array —

The collection of actions and filters registered with WordPress.