From 66d8f8ee087f73b98ee8e8780db0eb7e75f4e9ee Mon Sep 17 00:00:00 2001 From: Jb Audras Date: Wed, 1 Mar 2023 16:30:41 +0000 Subject: [PATCH] Media: Rename the `wp_ajax_save_attachment` action hook to `wp_ajax_save_attachment_updated`. This changeset renames the `wp_ajax_save_attachment` action to `wp_ajax_save_attachment_updated` to avoid confusion with the similarly named `wp_ajax_save-attachment` action. This also add a dockblock note to indicate that when checking if an action is being done, `doing_action( 'wp_ajax_save-attachment' )` may be used if that is more convenient. Follow-up to [55106]. Props azaozz, sc0ttkclark, costdev. Fixes #23148 git-svn-id: https://develop.svn.wordpress.org/trunk@55450 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/ajax-actions.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/includes/ajax-actions.php b/src/wp-admin/includes/ajax-actions.php index f24925c6af..5353a8ca05 100644 --- a/src/wp-admin/includes/ajax-actions.php +++ b/src/wp-admin/includes/ajax-actions.php @@ -3149,12 +3149,15 @@ function wp_ajax_save_attachment() { * Fires after an attachment has been updated via the Ajax handler * and before the JSON response is sent. * + * When checking if an action is being done, `doing_action( 'wp_ajax_save-attachment' )` + * may be used if that is more convenient. + * * @since 6.2.0 * * @param array $post The attachment data. * @param array $changes An array containing the updated attachment attributes. */ - do_action( 'wp_ajax_save_attachment', $post, $changes ); + do_action( 'wp_ajax_save_attachment_updated', $post, $changes ); } wp_send_json_success();