W3cubDocs

/WordPress

remove_all_actions( string $tag, int|bool $priority = false )

Remove all of the hooks from an action.

Parameters

$tag

(string) (Required) The action to remove hooks from.

$priority

(int|bool) (Optional) The priority number to remove them from.

Default value: false

Return

(true) True when finished.

More Information

  • 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.

Source

File: wp-includes/plugin.php

function remove_all_actions( $tag, $priority = false ) {
	return remove_all_filters( $tag, $priority );
}

Changelog

Version Description
2.7.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/remove_all_actions