Make WordPress Core

Changeset 55649


Ignore:
Timestamp:
04/12/2023 11:42:20 PM (18 months ago)
Author:
joedolson
Message:

Media: Render attachment custom fields for new uploads.

Initialize attachment custom fields during the add callback, so that fields are present as soon as an attachment is uploaded but do not refresh when field values are changed. Follow up to #40909.

Props trepmal, adamsilverstein, joedolson.
Fixes #58051.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/media/views/attachment-compat.js

    r55299 r55649  
    2323        'change select':   'save',
    2424        'change textarea': 'save'
     25    },
     26
     27    initialize: function() {
     28        // Render the view when a new item is added.
     29        this.listenTo( this.model, 'add', this.render );
    2530    },
    2631
Note: See TracChangeset for help on using the changeset viewer.