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.
Merges [55649] to the 6.2 branch.
Fixes #58051.

Built from https://develop.svn.wordpress.org/branches/6.2@55735


git-svn-id: http://core.svn.wordpress.org/branches/6.2@55247 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
audrasjb 2023-05-09 12:07:26 +00:00
parent c7f1d4266b
commit 5db2b65b67
3 changed files with 7 additions and 2 deletions

View File

@ -2464,6 +2464,11 @@ AttachmentCompat = View.extend(/** @lends wp.media.view.AttachmentCompat.prototy
'change textarea': 'save'
},
initialize: function() {
// Render the view when a new item is added.
this.listenTo( this.model, 'add', this.render );
},
/**
* @return {wp.media.view.AttachmentCompat} Returns itself to allow chaining.
*/

File diff suppressed because one or more lines are too long

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.2.1-alpha-55731';
$wp_version = '6.2.1-alpha-55735';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.