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

git-svn-id: https://develop.svn.wordpress.org/trunk@29278 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Helen Hou-Sandi 2014-07-23 22:08:17 +00:00
parent 15aaf0691a
commit 3d3b141b30
3 changed files with 14 additions and 1 deletions

View File

@ -440,6 +440,16 @@
controller: this, controller: this,
model: this.model 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 // Update browser url when navigating media details
if ( this.model ) { if ( this.model ) {
this.gridRouter.navigate( this.gridRouter.baseUrl( '?item=' + this.model.id ) ); this.gridRouter.navigate( this.gridRouter.baseUrl( '?item=' + this.model.id ) );
@ -678,4 +688,4 @@
} }
}); });
}(jQuery, _, Backbone, wp)); }(jQuery, _, Backbone, wp));

View File

@ -6407,6 +6407,8 @@
/** /**
* wp.media.view.AttachmentCompat * wp.media.view.AttachmentCompat
* *
* A view to display fields added via the `attachment_fields_to_edit` filter.
*
* @constructor * @constructor
* @augments wp.media.View * @augments wp.media.View
* @augments wp.Backbone.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> <span class="value"><a href="{{ data.uploadedToLink }}">{{ data.uploadedToTitle }}</a></span>
</label> </label>
<# } #> <# } #>
<div class="attachment-compat"></div>
</div> </div>
<a class="view-attachment" href="{{ data.link }}"><?php _e( 'View attachment page' ); ?></a> | <a class="view-attachment" href="{{ data.link }}"><?php _e( 'View attachment page' ); ?></a> |