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.
Built from https://develop.svn.wordpress.org/trunk@55649


git-svn-id: http://core.svn.wordpress.org/trunk@55161 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
joedolson 2023-04-12 23:44:22 +00:00
parent 7478b8d5af
commit 996fe7077e
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.3-alpha-55648';
$wp_version = '6.3-alpha-55649';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.