WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/remove all actions

Description

Remove all of the hooks from an action.

Usage

<?php remove_all_actions$tag$priority ?>

Parameters

$tag
(string) (required) The action to remove hooks from.
Default: None
$priority
(integer) (optional) The priority number to remove them from.
Default: false

Return Values

(boolean) 
True when finished.

Examples

Notes

You can't call this function from within the hook you would like to remove actions from. For example adding an action to wp_footer that calls remove_all_actions('wp_footer') will cause an infinite loop condition because the while loop suddenly doesn't have a next value. In WordPress 3.8.1 you'll get a warning message like: Warning: next() expects parameter 1 to be array, null given in wp-includes/plugin.php on line 431

You'll just need to hook into a hook that's called before the hook you wish to clear is called.

Change Log

Since: 2.7

Source File

remove_all_actions() is located in wp-includes/plugin.php.

Related

Action Functions

See also index of Function Reference and index of Template Tags.