Make WordPress Core

Changes between Version 1 and Version 2 of Ticket #23148, comment 52


Ignore:
Timestamp:
03/01/2023 05:50:22 PM (3 years ago)
Author:
azaozz
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #23148, comment 52

    v1 v2  
    55Sounds good. I'd like to expand the docs a bit more and explain that:
    66- There is a `wp_ajax_save-attachment` action that is very similar and is fired earlier.
    7 - The new `wp_ajax_save_attachment_updated` is full equivalent (duplicate?) of using any of the `save_post` hooks and checking where the data comes from by using `if ( doing_action( 'wp_ajax_save-attachment' ) )`.
     7- The new `wp_ajax_save_attachment_updated` is full equivalent (duplicate?) of using any of the "save_post" hooks:
     8  - The `sanitize_post_field()` filters: `pre_{$field}` and `{$field_no_prefix}_save_pre` or `pre_post_{$field}`, and `{$field}_pre`.
     9  - `wp_insert_post_empty_content`,
     10  - `wp_insert_attachment_data`,
     11  - `pre_post_update`,
     12  - `edit_attachment`,
     13  - `attachment_updated`,
     14
     15and checking where the data comes from by using `if ( doing_action( 'wp_ajax_save-attachment' ) )`.
    816
    917As that will be just a docs update it can be added at any time.