On this page
remove_action( string $hook_name, callable|string|array $callback, int $priority = 10 ): bool
Removes a callback function from an action hook.
Description
This can be used to remove default functions attached to a specific action hook and possibly replace them with a substitute.
To remove a hook, the $callback 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.
Parameters
$hook_namestring Required-
The action hook to which the function to be removed is hooked.
$callbackcallable|string|array Required-
The name of the function which should be removed.
This function can be called unconditionally to speculatively remove a callback that may or may not exist. $priorityint Optional-
The exact priority used when adding the original action callback.
Default:
10
Return
bool Whether the function is removed.
More Information
- This function is an alias to remove_filter() .
- See also add_action() and add_filter() .
- 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.
Source
File: wp-includes/plugin.php. View all references
function remove_action( $hook_name, $callback, $priority = 10 ) {
return remove_filter( $hook_name, $callback, $priority );
}
Related
Uses
| Uses | Description |
|---|---|
| remove_filter() wp-includes/plugin.php | Removes a callback function from a filter hook. |
Used By
| Used By | Description |
|---|---|
| locate_block_template() wp-includes/block-template.php | Finds a block template with equal or higher specificity than a given PHP template file. |
| wp_is_site_initialized() wp-includes/ms-site.php | Checks whether a site is initialized. |
| WP_Roles::get_roles_data() wp-includes/class-wp-roles.php | Gets the available roles data. |
| _wp_delete_customize_changeset_dependent_auto_drafts() wp-includes/nav-menu.php | Deletes auto-draft posts associated with the supplied changeset. |
| _wp_customize_publish_changeset() wp-includes/theme.php | Publishes a snapshot’s changes. |
| WP_Post_Type::unregister_meta_boxes() wp-includes/class-wp-post-type.php | Unregisters the post type meta box if a custom callback was specified. |
| WP_Post_Type::remove_hooks() wp-includes/class-wp-post-type.php | Removes the future post hook action for the post type. |
| WP_Automatic_Updater::run() wp-admin/includes/class-wp-automatic-updater.php | Kicks off the background update process, looping through all pending updates. |
| Language_Pack_Upgrader::bulk_upgrade() wp-admin/includes/class-language-pack-upgrader.php | Bulk upgrade language packs. |
| Theme_Upgrader::install() wp-admin/includes/class-theme-upgrader.php | Install a theme package. |
| Theme_Upgrader::upgrade() wp-admin/includes/class-theme-upgrader.php | Upgrade a theme. |
| Plugin_Upgrader::install() wp-admin/includes/class-plugin-upgrader.php | Install a plugin package. |
| Plugin_Upgrader::upgrade() wp-admin/includes/class-plugin-upgrader.php | Upgrade a plugin. |
| WP_MS_Themes_List_Table::single_row() wp-admin/includes/class-wp-ms-themes-list-table.php | |
| WP_Customize_Manager::__construct() wp-includes/class-wp-customize-manager.php | Constructor. |
| _remove_theme_support() wp-includes/theme.php | Do not use. Removes theme support internally without knowledge of those not used by themes directly. |
| check_theme_switched() wp-includes/theme.php | Checks if a theme has been changed and runs ‘after_switch_theme’ hook on the next WP load. |
| automatic_feed_links() wp-includes/deprecated.php | Enable/disable automatic general feed link outputting. |
| add_feed() wp-includes/rewrite.php | Adds a new feed type like /atom1/. |
| wp_print_media_templates() wp-includes/media-template.php | Prints the templates used in the media manager. |
Changelog
| Version | Description |
|---|---|
| 1.2.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/remove_action