Add support for attachment_fields_to_edit in the attachment details modal. props ericlewis. fixes #28991, see #24716.

Built from https://develop.svn.wordpress.org/trunk@29278


git-svn-id: http://core.svn.wordpress.org/trunk@29060 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Helen Hou-Sandí 2014-07-23 22:09:18 +00:00
parent cb2d88a092
commit 795c97d08b
4 changed files with 15 additions and 2 deletions

View File

@ -440,6 +440,16 @@
controller: this,
model: this.model
});
/**
* Attach a subview to display fields added via the
* `attachment_fields_to_edit` filter.
*/
contentRegion.view.views.set( '.attachment-compat', new media.view.AttachmentCompat({
controller: this,
model: this.model
}) );
// Update browser url when navigating media details
if ( this.model ) {
this.gridRouter.navigate( this.gridRouter.baseUrl( '?item=' + this.model.id ) );
@ -678,4 +688,4 @@
}
});
}(jQuery, _, Backbone, wp));
}(jQuery, _, Backbone, wp));

File diff suppressed because one or more lines are too long

View File

@ -6407,6 +6407,8 @@
/**
* wp.media.view.AttachmentCompat
*
* A view to display fields added via the `attachment_fields_to_edit` filter.
*
* @constructor
* @augments wp.media.View
* @augments wp.Backbone.View

View File

@ -386,6 +386,7 @@ function wp_print_media_templates() {
<span class="value"><a href="{{ data.uploadedToLink }}">{{ data.uploadedToTitle }}</a></span>
</label>
<# } #>
<div class="attachment-compat"></div>
</div>
<a class="view-attachment" href="{{ data.link }}"><?php _e( 'View attachment page' ); ?></a> |