Codex tools: Log in
Contents |
This function is an alias to remove_filter().
This function removes a function attached to a specified action hook. This method can be used to remove default functions attached to a specific action hook and possibly replace them with a substitute. See also remove_filter(), add_action() and add_filter().
Important: To remove a hook, the $function_to_remove and $priority arguments must match when the hook was added. This goes for both filters and actions. No warning will be given on removal failure.
<?php remove_action( $tag, $function_to_remove, $priority, $accepted_args ); ?>
This function is identical to the remove_filter() function.
<?php remove_action($tag, $function_to_remove, $priority, $accepted_args); ?>
If an action has been added from within a class, for example by a plugin, removing it will require accessing the class variable.
global $my_class; remove_action( 'the_content', array( $my_class, 'class_filter_function' ) );
It is also worth noting that you may need to prioritise the removal of the action to a hook that occurs after the action is added. You cannot successfully remove the action before it has been added.
Since: 1.2.0
remove_action() is located in wp-includes/plugin.php.
Actions: has_action(), add_action(), do_action(), do_action_ref_array(), did_action(), remove_action(), remove_all_actions()