Advanced Hooks API

Set of (experimental) wrappers that allow to hook more elaborate events without coding intermediary functions.

Author:Andrey "Rarst" Savchenko (profile at wordpress.org)
WordPress version required:3.2.1
WordPress version tested:3.5
Plugin version:0.7
Added to WordPress repository:15-08-2011
Last updated:18-12-2012
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
Rating, %:100
Rated by:2
Plugin URI:http://wordpress.org/extend/plugins/advanced-...
Total downloads:624
plugin download
Click to start download

WordPress only operates with callbacks for actions and filters. That means that you always need to use callback, either:

  • provided by core (limited)
  • closures (messy)
  • coded by yourself (this - a lot)

This plugins offers number of custom add_* functions to hook more elaborate events:

  • add_action_with_args() - hook callback and arguments to run it with
  • add_filter_return() - override filter with arbitrary value
  • add_filter_prepend() and add_filter_append() - hook suffix/prefix values for filtered string and arrays
  • add_filter_replace() - edit substrings or array values in filter
  • add_action_once() and add_filter_once() - hook callback to only fire once
  • add_method() - quickly add class methods to hooks of same name

Both implementation and set of functions are experimental.

Development repository and issue tracker.