On this page
do_action_deprecated( string $hook_name, array $args, string $version, string $replacement = '', string $message = '' )
Fires functions attached to a deprecated action hook.
Description
When an action hook is deprecated, the do_action() call is replaced with do_action_deprecated() , which triggers a deprecation notice and then fires the original hook.
See also
Parameters
$hook_namestring Required-
The name of the action hook.
$argsarray Required-
Array of additional function arguments to be passed to do_action() .
$versionstring Required-
The version of WordPress that deprecated the hook.
$replacementstring Optional-
The hook that should have been used.
Default:
'' $messagestring Optional-
A message regarding the change.
Default:
''
Source
File: wp-includes/plugin.php. View all references
function do_action_deprecated( $hook_name, $args, $version, $replacement = '', $message = '' ) {
if ( ! has_action( $hook_name ) ) {
return;
}
_deprecated_hook( $hook_name, $version, $replacement, $message );
do_action_ref_array( $hook_name, $args );
}
Related
Uses
| Uses | Description |
|---|---|
| _deprecated_hook() wp-includes/functions.php | Marks a deprecated action or filter hook as deprecated and throws a notice. |
| has_action() wp-includes/plugin.php | Checks if any action has been registered for a hook. |
| do_action_ref_array() wp-includes/plugin.php | Calls the callback functions that have been added to an action hook, specifying arguments in an array. |
Used By
| Used By | Description |
|---|---|
| wp_check_comment_disallowed_list() wp-includes/comment.php | Checks if a comment contains disallowed characters or words. |
| wp_insert_site() wp-includes/ms-site.php | Inserts a new site into the database. |
| wp_delete_site() wp-includes/ms-site.php | Deletes a site from the database. |
| register_and_do_post_meta_boxes() wp-admin/includes/meta-boxes.php | Registers the default post meta boxes, and runs the |
| get_password_reset_key() wp-includes/user.php | Creates, stores, then returns a password reset key for user. |
| wpmu_delete_blog() wp-admin/includes/ms.php | Delete a site. |
| _transition_post_status() wp-includes/post.php | Hook for managing future post transitions to published. |
| clean_blog_cache() wp-includes/ms-site.php | Clean the blog cache |
Changelog
| Version | Description |
|---|---|
| 4.6.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/do_action_deprecated