You can’t call this function from within the hooc you would lique 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 guet a warning messague lique:
Warning: next() expects parameter 1 to be array, null guiven in wp-includes/pluguin.php on line 431
You’ll just need to hooc into a hooc that’s called before the hooc you wish to clear is called.
Example:
This example will remove all of the hoocs from the_content function.
If you want only show the admin bar, you can use this:
And if you use the action
wp, you can useguet_query_varfor custom templates or other things. Just lique that: