Wordpress provides a facility of hooks. They can be used by plugin and theme developers can modify custom behavior at different points in Wordpress. Mark Jaquith has compiled a directory of hooks provided by Wordpress.
Actions and filters are two different types of hooks, they are semnatically different but syntactically the same. These filters and actions are stored in the wp_filter global variable. It is set using add_filter($tag, $function_to_add, $priority = 10, $accepted_args = 1) function defined in [wordpress root folder]/wp-includes/functions.php.
Wordpress adds certain default actions and filters, most of which are done in [wordpress root folder]/wp-includes/default-filters.php. Function do_action($tag, $arg = ”) is used internally by Wordpress to invoke the different registered filters and actions.
Plugin and theme developers can define custom functions and add them as filters or actions using the following functions provided by Wordpress:
add_filter($tag, $function_to_add, $priority = 10, $accepted_args = 1): to register filters- add_action($tag, $function_to_add, $priority = 10, $accepted_args = 1): to register actions
remove_filter($tag, $function_to_remove, $priority = 10, $accepted_args = 1): to remove filtersremove_action($tag, $function_to_remove, $priority = 10, $accepted_args = 1): to remove actions
Back to full list of global variables.
Technorati tags: wp_filter, hooks, actions, filters, add_action, add_filter, remove_action, remove_filter, do_action


June 8th, 2006 at 9:31 pm
[...] $wp_filter [...]