hellonico / wp-early-hooks
Add filters and actions before WordPress hooks functions are available
Installs: 725
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/hellonico/wp-early-hooks
Requires (Dev)
README
Add filters and actions (add_filter
and add_action
) before anything in WordPress has even started (such as advanced-cache hooks) thanks to the WP_Hook::build_preinitialized_hooks
method which normalizes raw shaped hooks (e.g. an array stored in $GLOBALS['wp_filter']
).
Usage
This package exposes two functions with the same signature than add_filter
and add_action
:
function add_filter_early($hook_name, $callback, $priority = 10, $accepted_args = 1);
function add_action_early($hook_name, $callback, $priority = 10, $accepted_args = 1);