Make WordPress Core

Changeset 55450


Ignore:
Timestamp:
03/01/2023 04:30:41 PM (14 months ago)
Author:
audrasjb
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/ajax-actions.php

    r55365 r55450  
    31503150         * and before the JSON response is sent.
    31513151         *
     3152         * When checking if an action is being done, `doing_action( 'wp_ajax_save-attachment' )`
     3153         * may be used if that is more convenient.
     3154         *
    31523155         * @since 6.2.0
    31533156         *
     
    31553158         * @param array $changes An array containing the updated attachment attributes.
    31563159         */
    3157         do_action( 'wp_ajax_save_attachment', $post, $changes );
     3160        do_action( 'wp_ajax_save_attachment_updated', $post, $changes );
    31583161    }
    31593162
Note: See TracChangeset for help on using the changeset viewer.