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

Built from https://develop.svn.wordpress.org/trunk@55450


git-svn-id: http://core.svn.wordpress.org/trunk@54983 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
audrasjb 2023-03-01 16:32:20 +00:00
parent 7a4b3a5dab
commit 3fdc61552e
2 changed files with 5 additions and 2 deletions

View File

@ -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();

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.2-beta3-55449';
$wp_version = '6.2-beta3-55450';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.